User Guide
_root 713
_root
Availability
Flash Player 5.
Usage
_root.movieClip
_root.action
_root.property
Parameters
movieClip
The instance name of a movie clip.
action An action or method.
property A property of the MovieClip object.
Description
Identifier; specifies or returns a reference to the root movie clip Timeline. If a movie clip
has multiple levels, the root movie clip Timeline is on the level containing the currently executing
script. For example, if a script in level 1 evaluates
_root, _level1 is returned.
Specifying
_root is the same as using the deprecated slash notation (/) to specify an absolute path
within the current level.
Caution: If a movie clip that contains _root is loaded into another movie clip, _root refers to the
Timeline of the loading movie clip, not the Timeline that contains
_root. If you want to ensure that
_root refers to the Timeline of the loaded movie clip even if it is loaded into another movie clip, use
MovieClip._lockroot.
Example
The following example stops the Timeline of the level containing the currently executing script:
_root.stop();
The following example traces variables and instances in the scope of _root:
for (prop in _root) {
trace("_root."+prop+" = "+_root[prop]);
}
See also
MovieClip._lockroot, _parent, targetPath()
CHAPTER 2
ActionScript Language Reference