MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference page 304

Actionscript language reference
Table of Contents

Advertisement

//output
myObject.name = Tara
myObject.age = 27
myObject.city = San Francisco
The following example shows using
var myArray:Array = new Array("one", "two", "three");
for (var index in myArray)
trace("myArray["+index+"] = " + myArray[index]);
// output:
myArray[2] = three
myArray[1] = two
myArray[0] = one
The following example uses the
child:
for (var name in this) {
if (typeof (this[name]) == "movieclip") {
trace("I have a movie clip child named "+name);
}
}
Note: If you have several movie clips, the output consists of the instance names of those clips.
The following example enumerates the children of a movie clip and sends each to Frame 2 in their
respective Timelines. The
_RedRadioButton_
for (var name in RadioButtonGroup) {
RadioButtonGroup[name].gotoAndStop(2);
}
304
Chapter 2: ActionScript Language Reference
for..in
operator with
typeof
RadioButtonGroup
,
_GreenRadioButton_,
to iterate over the elements of an array:
to iterate over a particular type of
for..in
movie clip is a parent with several children,
and
_BlueRadioButton
.

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?

Questions and answers

This manual is also suitable for:

Flash mx

Table of Contents