0
votes

I have made a movie clip which I export to ActionScript 3.

In this movie clip I have drawn a text field (area? well TEXT) using the plain "Text Tool".

After selecting the text, and after I have entered "0" to be displayed, I edit its properties. It's Instance Name, defined at the very top of the list I have written "score". The text engine is TLF Text and the text type "Read only".

When I have made a instance of the movie clip using AS3 I can't get the value of the text instance named "score" - when calling something like trace(getChildByName("score")) in the constructor I just get null.

I want to be able to get the value of the text "score", and I would also like to change its value.

Just how do I get the value from ActionScript? I don't want to have to create the text progamatically and position it, and I doubt that I have to.

Please tell me how to access the "score" instance.

1
no need to use getChildByName... you can just do: mcname.score.textZevan

1 Answers

0
votes

The answer was that it's not available from the constructor since the object hasn't been instanciated itself yet.

I made a function that's called after the constructor had returned and then "score" could be found.