Share this Page URL

Part: II Creating Flash Sites > Movie Clip Control - Pg. 114

114 Chapter 5. Movie Clip Control IN THIS CHAPTER · Movie Clip Levels and Hierarchies · The MovieClip Class · Linking User Classes to Movie Clips Movie Clip Levels and Hierarchies Chapter 4, "Animations and Interactions," covered the animation development process, using both the main Timeline and movie clips. This chapter brings out the true flexibility and power of movie clips as they can be used in Flash Pro. Movie clips have their own Timelines, and a movie in the form of a SWF file or movie clip can be loaded into another movie or movie clip. Because of the different places where a movie clip can be located relative to the main Timeline, the initial level (_level0), and other movie clips, understand- ing Flash's movie and movie clip hierarchy needs to be a top priority for developers and designers. The following key identifiers and properties make up the primary terms used to address a movie clip from the main Timeline or from another movie clip: · · · · _level _root _lockroot _parent Using _root and _level The _root property is often used (and misused) to address either the main Timeline or an object on the main Timeline. For example, the following two lines illustrate typical uses of _root: _root.gotoAndStop(7); _root.house_mc._alpha=88; Depending on the circumstances, these lines of code may or may not do what the developer expects. If the commands are issued from an object on level 59, they will only affect the main Timeline of _level59. Assuming that the code is from level 59, the same code would be correctly written as follows: _level59.gotoAndStop(7); _level59.house_mc._alpha=88; However, if the developer really meant to address the main Timeline of the zero level--what many consider to be the "bedrock" level of a movie--the script should be written as follows: