Made to Order Software Corporation Logo

Enumerate Object

SWF Action
Action Category: 
Objects
Action Details: 
0
Action Identifier: 
85
Action Structure: 
<n.a.>
Action Length: 
0 byte(s)
Action Stack: 
pop 1 (o), push null, push * (s)
Action Operation: 
o1 := pop();
push(null);
foreach(o1 as name) {
  push(name);
}
Action Flash Version: 
6

Pop an object from the stack, push a null, then push the name of each variable and function member of that object on the stack.

This mechanism can be used to implement a foreach() function on an object. Be careful, though, that the stack be cleared when leaving the loop.

This action uses an object reference. If you only have the name of the object, use the Enumerate action instead.

Note that internal functions, such as the play() function on a MovieClip1, are enumerated but they cannot really be dealt with easily. Their name is generally not shown (I think that there is a flag one can change to show those name though.)

  • 1. MovieClip is the proper type for a Sprite in an ActionScript.