Q:

Accessing SimpleButton TextField

I've been trying to change the text within a SimpleButton instance using this:
var drawButton:SimpleButton = main.drawButton;
var upButton:DisplayObjectContainer = drawButton.upState as DisplayObjectContainer;
var upButtonText:TextField = upButton.getChildAt(1) as TextField;
upButtonText.text = "Pause";

I found this solution from here: how can i change texts in the dynamic textFields in SimpleButton instance (button symbol)?
Unfortunately, upButtonText return as null. According to the debug, upButton has 3 children, so I tried getChildAt([0-2]) to try and get the text but didn't happen. Also tried getting it by instance name, also no luck. Does anyone know why this isn't working?
Appreciate the help.

A:

For others' information I first of all set the TLF text to Editable.
Then I used this code to get the String inside the button:
var upState:Sprite = Sprite(drawButton.upState);
var upText:String = TLFTextField(upState.getChildAt(2)).text;

and to change the text: TLFTextField(upState.getChildAt(2)).text = "Paused";
This definitely works, and is tested.
Thanks to user elekwent for the tips.

