Actionscript 3 动态文本字段不显示为3

Actionscript 3 动态文本字段不显示为3,actionscript-3,flash-cs6,dynamic-text,Actionscript 3,Flash Cs6,Dynamic Text,我已在.as文件中实例化: private var heroLives:int; heroLives = 3; 随后在代码中,我调用了一个名为showherolifes()的函数,如下所示: public function showheroLives() { heroLivesTxt.text = String(heroLives); trace(heroLivesTxt.text); trace(heroLives); } 我只是用trace来确保heroLive

我已在.as文件中实例化:

private var heroLives:int;

heroLives = 3;
随后在代码中,我调用了一个名为showherolifes()的函数,如下所示:

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

我只是用trace来确保heroLivesTxt得到了heroLives的更新。heroLivesTxt是舞台上的动态文本字段。如果我注释掉ShowHeroLifes(),这样它就不会尝试赋值,heroLivesTxt的赋值(在后台)就会显示出来。但一旦我通过代码实现showHeroLives()来更新文本,它就会消失,即使跟踪显示我已经更新了文本。请帮忙

您需要嵌入字体。您可以通过文本字段的“属性”面板将其嵌入。

字体是否嵌入?字体使其工作!谢谢