MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference page 59

Actionscript language reference
Table of Contents

Advertisement

In the following example, the expression inside the brackets is evaluated, and the result is used as
the name of the variable to be retrieved from movie clip
name_mc["A" + i];
If you are familiar with the Flash 4 ActionScript slash syntax, you can use the
accomplish the same result:
eval("name_mc.A" & i);
You can use the following ActionScript to loop over all objects in the
for debugging:
for (i in _root) {
trace(i+": "+_root[i]);
}
You can also use the array access ([]) operator on the left side of an assignment statement to
dynamically set instance, variable, and object names:
employee_array[2] = "Sam";
See also
Array
class,
Object class
:
name_mc
eval()
scope, which is useful
_root
[] (array access)
function to
59

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash mx

Table of Contents