mardi 29 septembre 2015

change text of TLFTextField through constructor

I have a symbol which extends MovieClip and it has a TLFTextField instance in it. I try to change the text of the TLFTextField in the constructor, like this:

public function mySymbol() 
{
    myTLF.text = "texty text";
}

I create a new instance of the class mySymbol in my DocumentClass:

public function DocumentClass() 
{
    var mySymbol:MySymbol = new MySymbol();
    addChild(mySymbol);
}

The symbol is created and added to stage (I know that because it has a border and background color) but nothing shows up inside myTLF.

If instead of trying to change the text in the constructor, I change it in the DocumentClass() (using mySymbol.myTLF.text = "texty text"; it does show up.

What am I missing here?

Aucun commentaire:

Enregistrer un commentaire