Adobe FLASH CS3 PRO User Manual page 78

Hide thumbs Also See for FLASH CS3 PRO:
Table of Contents

Advertisement

You can use the
alias to refer to the main Timeline of the current level. For the main Timeline, the
_root
stands for
when targeted by a movie clip also on
_level0
equal to
when targeted by a movie clip also on level 5. For example, if the movie clips
_level5
are both loaded into the same level, an action called from the instance
florida
following absolute path to target the instance
_root.eastCoast.florida
About relative paths
A relative path depends on the relationship between the controlling Timeline and the target Timeline. Relative paths
can address targets only within their own level of Flash Player. For example, you can't use a relative path in an action
on
that targets a Timeline on
_level0
In a relative path, use the keyword
to indicate the parent Timeline of the current Timeline. You can use the
in the movie clip hierarchy within the same level of Flash Player. For example,
clip up two levels in the hierarchy. The topmost Timeline at any level in Flash Player is the only Timeline with a
value that is undefined.
_parent
An action in the Timeline of the instance
following target path to target the instance
_parent
To target the instance
eastCoast
_parent._parent
To target the instance
atlanta
_parent._parent.georgia.atlanta
Relative paths are useful for reusing scripts. For example, you could attach the following script to a movie clip that
magnifies its parent by 150%:
onClipEvent (load) {_parent._xscale = 150;_parent._yscale = 150;
}
You can reuse this script by attaching it to any movie clip instance.
Note: Flash Lite 1.0 and 1.1 support attaching scripts only to buttons. Attaching scripts to movie clips is not supported.
Whether you use an absolute or a relative path, you identify a variable in a Timeline or a property of an object with
a dot (
) followed by the name of the variable or property. For example, the following statement sets the variable
.
in the instance
to the value
form
_root.form.name = "Gilbert";
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
florida
.
_level5
to refer to the current Timeline in the current level; use the
this
charleston
southcarolina
(one level up) from an action in
from an action in the Timeline of
:
"Gilbert"
, and
. Each of these movie clips in turn contains two movie clips.
washington
. For a document loaded into
_level0
southcarolina
:
_parent
_parent._parent
, located one level below
southcarolina
:
, you could use the following relative path:
charleston
, you could use the following relative path:
charleston
_root
,
_level5
_root
southcarolina
could use the
_parent
alias repeatedly to go up one level
controls a movie
, could use the
FLASH CS3
72
User Guide
alias
is
and
alias
name

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash cs3 professional

Table of Contents