Setting text property of a TextField
Ok, I'm kinda lost, I have a TextField and I want to set it's text property to a new text. But when I do it, the TextFild.text gets set, but is not beeing displayed.
the code so far
private var tf:TextField;
public function setGame():void {
if (upcoming == true) {
tf = new TextField();
var tFormat:TextFormat = new TextFormat();
var tFont:Font = new Dota2();
tFormat.font = tFont.fontName;
tFormat.size = 48;
tFormat.color = 0x323232;
tf.x = 230;
tf.autoSize = TextFieldAutoSize.CENTER;
tf.text = "Next Match In"; // thats beeing displayed
tf.setTextFormat(tFormat);
tf.embedFonts = true;
addChild(tf);
}
}
private function timerUp(e:Event):void {
tf.text = "Next Match Is About To Start"; // text just disappears
removeChild(clock); // this gets executed
}
Maybe I do something wrong with the order of the code or something.