You're not being very clear with the question. If you want to add a ComboBox to the screen in AS3, your code works, except you need to attach it to something. e.g.,
var c:ComboBox = new ComboBox();
c.dataProvider = yourData;
someCanvas.addChild(c);
However, if you want to build your own ComboBox
and have it pop up in a similar way, you're treading into more complicated land. The basics are that it's just a TextInput
control where you use the PopupManager
to show/hide a List
object depending on the user action (e.g., click, typing, etc...). But you will run into lots of focus/event issues.
Take a look at the ComboBox source code in the Flex SDK.