
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Referring to Instances and Main Movies
|
353
Like the _root property, the _leveln property can be combined with ordinary
instance references via the dot operator:
_level1.clipA.stop();
As with references to _root, references to _leveln properties are called absolute refer-
ences because they lead to the same destination from any point in a document.
Note that
_leveln and _root are not synonymous. The _root property is always the
current document’s main timeline, regardless of the level on which the current docu-
ment resides, whereas the
_leveln property is a reference to the main timeline of a
specific document level. For example, suppose we place the code _root.play() in
myMovie.swf. When we load myMovie.swf onto level 5, our code plays
_level5’s
main movie timeline. In contrast, if we place the code _level2.play() in myMovie.swf
and load myMovie.swf into level 5, our code plays
_level2’s main movie timeline, not
_level5’s. Of course, from within level 2, _root and _level2 are equivalent.
Authoring Instance References with Insert Target Path
When the instance structure of a movie gets very complicated, composing references
to movie clips and main movies can be laborious. We may not always recall the exact
hierarchy of a series of clips and, hence, may end up frequently selecting and editing ...