TextField instance inside a button created in a separate layer in Flash is null in Flex
- by php html
I've created an button object in flash. The button contains 2 layers. One is the background image and on top of it is a textField. The textfield is dynamic. I use the button inside a movieclip and I export it in a SWC. The I'm trying to use it in flex.
I'm trying to do this:
var myComponent:MyComponent = new MyComponent();
myComponent.button01.theTextField.text = "Caption";
I get and instance of the button, but the instance of the textField is null and I'm not able to change the text(but the default text appears onscreen). Does anyone has any idea what is wrong?
Here is the button timeline(Layer 2 contains the textfield, and the textfield instance is named theTextField):