[Flash MX] Problem: Accessing a component from inside a movie clip

Okay I have this problem and I can’t for the life of me figure out what’s wrong. Here is an outline of what is happening:

  1. I have a movie clip that contains two components, a combo box and a check box.

  2. The combo box has the instance name “comboBox”, and the check box has the instance name “checkBox”.

  3. The movie clip is exported for actionscript with the identifier “test”.

  4. I run the following code:

[AS]
attached = _root.attachMovie(“test”,“componentContainer”, 1);
attached.comboBox.addItem(“A”, 1);[/AS]

  1. The item is not added to the combobox and I can’t figure out why.

However, when I run the following code instead:

[AS]
attached = _root.attachMovie(“test”,“componentContainer”, 1);
attached.comboBox._visible = false;[/AS]

The combobox becomes invisible!

I can’t understand why the addItem() function doesn’t work but the _visible property does. Could it be a bug? Or some type of referencing issue? Please, I’d appreciate any help or ideas about why this is happening.