Movie clip hierarchy

The parent-child relationships of movie clips are hierarchical. To understand this hierarchy, consider the hierarchy on a computer: the hard disk has a root directory (or folder) and subdirectories. The root directory is analogous to the main Timeline of a Flash document: it is the parent of everything else. The subdirectories are analogous to movie clips.

You can use the movie clip hierarchy in Flash to organize related objects. Any change you make to a parent movie clip is also performed on its children.

For example, you could create a Flash document containing a car that moves across the Stage. You could use a movie clip symbol to represent the car and set up a motion tween to move it across the Stage.

To add wheels that rotate, you could create a movie clip for a car wheel, and create two instances of this movie clip, named frontWheel and backWheel. Then you could place the wheels on the car movie clip's Timeline—not on the main Timeline. As children of car, frontWheel and backWheel are affected by any changes made to car; they move with the car as it tweens across the Stage.

To make both wheel instances spin, you could set up a motion tween that rotates the wheel symbol. Even after you change frontWheel and backWheel, they continue to be affected by the tween on their parent movie clip, car; the wheels spin, but they also move with the parent movie clip car across the Stage.