actionscript-3flash-cs6dynamic-text

Dynamic Textfield not Displaying as3


I have instantiated in my .as file:

private var heroLives:int;

heroLives = 3;

then later on in the code I call a function called showHeroLives() which looks like this:

public function showheroLives() {
    heroLivesTxt.text = String(heroLives);
    trace(heroLivesTxt.text);
    trace(heroLives);
}

I just used trace to make sure that heroLivesTxt gets updated with heroLives. heroLivesTxt is a dynamic textfield on stage. If I comment out showHeroLives() so it doesn't try to assign a value, the assigned value (within the stage) of heroLivesTxt shows up. But once I implement showHeroLives() to update the text through code, it disappears, even though it trace shows that I have updated the text. Please Help!


Solution

  • You need to embed the font. You can embed it via the properties panel of the TextField.