[ ]
- Started
- Last post
- 5 Responses
- CyBrainX
I'm having some trouble with dynamically named text fields within a dynamically created and named movie clip. Is there anything wrong with the following syntax?:
_root["btn"+i+".btnName"+i].text = "btnName"+i;
I don't get an action script error, but I don't get text either.
Here's the movie if you want to see:
- MX_OnD0
is it in a fer loop, aye?
tried deein' a
trace(_root["btn"+i+".btnName"+i...
??
- Anarchitect0
should be:
an instance inside anoter instance should be written like this:
_root["btn"+i]["btnName"+i].text = "btnName"+i;
use trace to see if it returns the instance name instead of undefined:
trace(_root["btn"+i]);
trace(_root["btn"+i]["btnName"+i...
- CyBrainX0
Thanks.
_root["btn"+i]["btnN ame"+i].text = "btnName"+i;
was the answer.
- CyBrainX0
The funny thing about this movie was that when I got the text labels to show in the movie clip, all the button scripts were disabled until I changed the TextFormat to selectable = false;
- gabriel20
I believe if the text is selectable, that overrides the button actions.