For - MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference

Actionscript language reference
Table of Contents

Advertisement

for..in
Availability
Flash Player 5.
Usage
for(variableIterant in object){
statement(s);
}
Parameters
variableIterant
object or element in an array.
The name of an object to be iterated.
object
statement(s)
Returns
Nothing.
Description
Statement; iterates over the properties of an object or elements in an array and executes the
for each property or element. Methods of an object are not enumerated by the
statement
action.
for..in
Some properties cannot be enumerated by the
properties, such as
enumerable, unlike instance members.
The
statement iterates over properties of objects in the iterated object's prototype chain.
for..in
Properties of the object are enumerated first, then properties of its immediate prototype, then
properties of the prototype's prototype, and so on. The
the same property name twice. If the object
property
, the
prop
the one in
parent
The curly braces (
statement are not necessary if only one statement will execute.
If you write a
for..in
available for the loop, but static members are. However, if you write a
for an instance of the class, then instance members are available but static ones are not.
Examples
The following example shows using
var myObject:Object = {name:"Tara", age:27, city:"San Francisco"};
for (var name in myObject) {
trace("myObject."+name+" = "+myObject[name]);
}
The name of a variable to act as the iterant, referencing each property of an
An instruction to execute for each iteration.
and
, are not enumerated. In external class files, static members are not
_x
_y
statement called on
for..in
.
) used to enclose the block of statements to be executed by the
{}
loop in a class file (an external AS file), then instance members are not
for..in
ActionScript Language Reference
action. For example, movie clip
for..in
for..in
has prototype
child
enumerates
child
to iterate over the properties of an object:
CHAPTER 2
statement does not enumerate
and both contain the
parent
from
but ignores
prop
child
for..in
loop in a FLA file
for..in
for..in
303

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

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash mx

Table of Contents