Loops

We can use a loop to control all of the children of a movie or movie clip.

In this example, there are several objects on the stage: 2 buttons, 2 movie clips (blue circles), and a group (red star).design

When we run the movie, we use ActionScript to set the x value of all of the display objects to 0.

var i:int;
var d:DisplayObject;
for(i=0;i<this.numChildren;i++) {
  d=getChildAt(i);
  d.x=0;
}
running

Notice that the group does not move. It is not a display object and it is not a child.

NEXT: Move only instances of Spinner