User Guide

24 Chapter 1: Working with Flash Documents
The following example shows the hierarchy of a document named westCoast on level 0, which
contains three movie clips: california, oregon, and washington. Each of these movie clips in turn
contains two movie clips.
_level0
westCoast
california
sanfrancisco
bakersfield
oregon
portland
ashland
washington
olympia
ellensburg
As on a web server, each Timeline in Flash can be addressed in two ways: with an absolute path or
with a relative path. The absolute path of an instance is always a full path from a level name,
regardless of which Timeline calls the action; for example, the absolute path to the instance
california is _level0.westCoast.california. A relative path is different when called from
different locations; for example, the relative path to
california from sanfrancisco is
_parent
, but from portland, it’s _parent._parent.california.
Absolute paths
An absolute path starts with the name of the level into which the document is loaded and
continues through the display list until it reaches the target instance. You can also use the alias
_root to refer to the topmost Timeline of the current level. For example, an action in the movie
clip
california that refers to the movie clip oregon could use the absolute path
_root.westCoast.oregon.
The first document to open in Flash Player is loaded at level 0. You must assign each additional
loaded document a level number. When you use an absolute reference in ActionScript to
reference a loaded document, use the form
_levelX, where X is the level number into which the
document is loaded. For example, the first document that opens in Flash Player is called
_level0;
a document loaded into level 3 is called
_level3.
To communicate between documents on different levels, you must use the level name in the
target path. The following example shows how the
portland instance would address the atlanta
instance located on a movie clip called
georgia (georgia is at the same level as oregon):
_level5.georgia.atlanta
You can use the alias _root to refer to the main Timeline of the current level. For the main
Timeline, the
_root alias stands for _level0 when targeted by a movie clip also on _level0. For
a document loaded into
_level5, _root is equal to _level5 when targeted by a movie clip also
on level 5. For example, if the movie clips
southcarolina and florida are both loaded into the
same level, an action called from the instance
southcarolina could use the following absolute
path to target the instance
florida:
_root.eastCoast.florida