40 Working with Flash Documents
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
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
_level0 that targets a Timeline
on
_level5.
In a relative path, use the keyword
this to refer to the current Timeline in the current level;
use the alias
_parent to indicate the parent Timeline of the current Timeline. You can use the
_parent alias repeatedly to go up one level in the movie clip hierarchy within the same level
of Flash Player. For example,
_parent._parent controls a movie clip up two levels in the
hierarchy. The topmost Timeline at any level in Flash Player is the only Timeline with a
_parent value that is undefined.
An action in the Timeline of the instance
charleston, located one level below
southcarolina, could use the following target path to target the instance southcarolina:
_parent
To target the instance eastCoast (one level up) from an action in charleston, you could use
the following relative path:
_parent._parent
To target the instance atlanta from an action in the Timeline of charleston, you could use
the following relative path:
_parent._parent.georgia.atlanta