PDA

View Full Version : ComboBox in AS class file


JayKay
03-05-2007, 07:23 PM
Hi,

I hope that someone can clarify this for me. I have made a class which extends the type MovieClip. The movieClip associated with the class contains some comboBoxes.

When I declare the comboBoxes within the AS class file do set there type to mx.controls.comboBox ?

ie...

var my_comboBox1:mx.controls.comboBox
var my_comboBox2:mx.controls.comboBox
var my_comboBox3:mx.controls.comboBox

..etc

I already have import mx.controls.comboBox at the top of my AS class file.

By doing this, I am now not getting type mismatch errors, however the code to populate and manipulate them does not seem to work inthe way that it should. I know that the logic is correct, as I had the functionality working by coding it into the first frame of the timeline in a FLA first.


If anyone could provide me with some example code of how to incorporate components into a class, then I would be really grateful.

I must be not quite grasping something as I have had a similar problem with nested movieclips in a similar situatuion.

Thanks for reading this far!