MACROMEDIA FLASH MX 2004-USING FLASH Use Manual page 25

Hide thumbs Also See for FLASH MX 2004-USING FLASH:
Table of Contents

Advertisement

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
on
.
_level5
In a relative path, use the keyword
the alias
_parent
alias repeatedly to go up one level in the movie clip hierarchy within the same level of
_parent
Flash Player. For example,
The topmost Timeline at any level in Flash Player is the only Timeline with a
is undefined.
An action in the Timeline of the instance
could use the following target path to target the instance
_parent
To target the instance
the following relative path:
_parent._parent
To target the instance
following relative path:
_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.
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 (
following statement sets the variable
_root.form.name = "Gilbert";
Writing target paths
To control a movie clip, loaded movie, or button, you must specify a target path. In order to
specify a target path for a movie clip or button, you must assign an instance name to the movie
clip or button. A loaded document doesn't require an instance name because you use its level
number as an instance name (for example,
this
to indicate the parent Timeline of the current Timeline. You can use the
_parent._parent
(one level up) from an action in
eastCoast
from an action in the Timeline of
atlanta
) followed by the name of the variable or property. For example, the
.
name
_level0
to refer to the current Timeline in the current level; use
controls a movie clip up two levels in the hierarchy.
, located one level below
charleston
southcarolina
in the instance
form
).
_level5
Using absolute and relative target paths
that targets a Timeline
_parent
southcarolina
:
, you could use
charleston
, you could use the
charleston
to the value
"Gilbert"
value that
,
:
25

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash mx 2004 - actionscript

Table of Contents