This content has been marked as final. Show 6 replies
what are a few of the button names?
Currently the instances are just named 1,2,3,4 serially which I discovered does not work. I need to raname them to something like a1,a2 just so they work. Later, these numbers will be mapped to another scheme so I will have a translation table so for example button a1 will be named something like NT065
if you want to apply some code to buttons with instance names a1_btn, a2_btn etc, you can use:
This is nice to know. Thanks. So is it impossible to step through the buttons similar to the way you would do links=document.getElementByTagName('a') in DOM and then step through the variable links to process all links in turn by using a loop?
i don't know about DOM.
DOM = document object models, allow us to access the contents via structured objects in the document.
In HTML, if you have a picture named "b1", then you can use document.getElementByTagName('b1') to refer to the picture.
In flash, if you have a movieclip/button instance called "b1",
to access the instance, we just say.... b1
or _level0.b1, _root.b1, _parent.b1 & etc.
this is how we access objects in flash.
to change the name of your buttons b1, b2, b3, you can try actionscripts below:
b1._name = "NT065";
b2._name = "NT066";
b3._name = "NT067";
this will change the name of your buttons to NT065, NT066, NT067.
You can also use a for loop to change the buttons name, using script below:
this["b"+i]._name = "NT0"+(64+i);
to expand all buttons name with "_btn", try script below:
this["b"+i]._name += "_btn";