Using absolute and relative target paths
39
Using absolute and relative target paths
You can use ActionScript to send messages from one Timeline to another. The Timeline that
contains the action is called the
controlling Timeline
, and the Timeline that receives the action
is called the
target Timeline
. For example, there could be an action on the last frame of one
Timeline that tells another Timeline to play. To refer to a target Timeline, you must use a
target path, which indicates the location of a movie clip in the display list.
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
.
About 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
_level
X
, 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
.
Summary of Contents for FLASH 8-FLASH
Page 1: ...Using Flash ...
Page 12: ...12 Contents ...
Page 110: ...110 Using Symbols Instances and Library Assets ...
Page 128: ...128 Working with Color Strokes and Fills ...
Page 156: ...156 Drawing ...
Page 190: ...190 Working with Text ...
Page 224: ...224 Working with Graphic Objects ...
Page 270: ...270 Creating Motion ...
Page 310: ...310 Working with Video ...
Page 362: ...362 Working with Screens Flash Professional Only ...
Page 386: ...386 Creating Multilanguage Text ...
Page 454: ...454 Data Integration Flash Professional Only ...
Page 500: ...500 Publishing ...
Page 534: ...534 Creating Accessible Content ...