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
called from different locations; for example, the relative path to
is
sanfrancisco
_parent
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
to refer to the topmost Timeline of the current level. For example, an action in the
_root
movie clip
california
_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
number into which the document is loaded. For example, the first document that opens in
Flash Player is called
is
_level0.westCoast.california
, but from
portland
that refers to the movie clip
.
; a document loaded into level 3 is called
_level0
. A relative path is different when
california
, it's
_parent._parent.california
could use the absolute path
oregon
, where
_levelX
Using absolute and relative target paths
from
.
is the level
X
.
_level3
39
Need help?
Do you have a question about the FLASH 8-USING FLASH and is the answer not in the manual?
Questions and answers