User Guide
[] (array access) 59
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:
name_mc["A" + i];
If you are familiar with the Flash 4 ActionScript slash syntax, you can use the eval() function to
accomplish the same result:
eval("name_mc.A" & i);
You can use the following ActionScript to loop over all objects in the _root scope, which is useful
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