I have the Dynamic Text field that has an instance name on a mid-timeline frame in Flash CS4.
I have a class that inherits from Sprite, and which is always added to the stage on instantiation. How can I get a reference to my Dynamic Text instance from this class?
Thanks!
EDIT: example:
My Main class (linked in Flash's publish settings) goes like this:
protected function beginGame(e:MouseEvent){
gotoAndStop(8);
var game:GameContainer = new GameContainer(41,8);
addChild(game);
game.x=36;
game.y=128;
}
Game Container extends MovieClip, and draws some pretty gfx.
On Frame 8, in the Flash IDE, there is a Dynamic Text element instance named "scoreText".
I want to access this from the GameContainer class.
Possible?
As long as GameContainer is on the stage you can do:
if (MovieClip(root).scoreText) {
MovieClip(root).scoreText.text = "hello";
}
If it's not on the stage it won't have a root property.