Luke Wenke Luke Wenke - 21 days ago 6
ActionScript Question

Can't get dynamic text to show update in flash, but trace works

I'm using text that is set to "dynamic text".

In actionscript 3 I tried:

instancename.text = "abc";
trace(instancename.text);


Trace returns "abc" when I test the movie but the appearance of the text doesn't change.

In action script 2 I tried:

var1 = "abc";
instance1._text = "def";
trace(var1 + instance1._text);


Trace returns "abcdef" when I test the movie but the appearance of the text doesn't change.

Thanks.

Answer

In actionscript 2, your lines should be

var1 = "abc";
instance1.text = "def";
trace(var1 + instance1.text);

(remove the _ char)

Moreover, try with

instance1.htmlText = "def";

this depends on how you have setup your textfield box.

Another important consideration: make sure that you have embedded the font in the textfield (Embed... button in Properties palette)