Hey,
I’m dynamically loading a movieclip onto the stage.
...
private var _endGame:The_end = new The_end();
...
_endGame = new The_end();
stage.addChild(_endGame);
In this movieclip I have a dynamic text field named ‘game_score_txt’
In the class for this movieclip; The_end.as I want to display some text.
I figured the following code would work:
package
{
import flash.display.MovieClip;
import flash.events.*;
public class The_End extends MovieClip
{
public function The_End()
{
stage.addEventListener(Event.ENTER_FRAME, display_text);
}
public function display_text(event:Event)
{
game_score_txt.text = String("hello world");
}
}
}
But I get the following error:
1046: Type was not found or was not a compile-time constant: TextField.
Any help would be much appreciated.