MovieClip
895
this.stopDrag();
};
The
MovieClip.getNextHighestDepth()
method used in this example requires Flash Player
7 or later. If your SWF file includes a version 2 component, use the version 2 components
DepthManager class instead of the
MovieClip.getNextHighestDepth()
method.
See also
globalToLocal (MovieClip.globalToLocal method)
_lockroot (MovieClip._lockroot property)
public _lockroot : Boolean
A Boolean value that specifies what
_root
refers to when a SWF file is loaded into a movie
clip. The
_lockroot
property is
undefined
by default. You can set this property within the
SWF file that is being loaded or in the handler that is loading the movie clip.
For example, suppose you have a document called Games.fla that lets a user choose a game to
play, and loads the game (for example, Chess.swf ) into the
game_mc
movie clip. Make sure
that, after being loaded into Games.swf, any use of
_root
in Chess.swf refers to
_root
in
Chess.swf (not
_root
in Games.swf ). If you have access to Chess.fla and publish it to Flash
Player 7 or later, you can add this statement to Chess.fla on the main Timeline:
this._lockroot = true;
If you don't have access to Chess.fla (for example, if you are loading Chess.swf from someone
else's site into
chess_mc
), you can set the Chess.swf
_lockroot
property when you load it.
Place the following ActionScript on the main Timeline of Games.fla:
chess_mc._lockroot = true;
In this case, Chess.swf can be published for any version of Flash Player, as long as Games.swf
is published for Flash Player 7 or later.
When calling
loadMovie()
, set the
MovieClip._lockroot
property to
true
in the loader
movie, as the following code shows. If you don't set
_lockroot
to
true
in the loader movie,
any references to
_root
in the loaded movie point to the
_root
of the loader instead of the
_root
of the loaded movie:
myMovieClip._lockroot = true;
Availability:
ActionScript 1.0; Flash Player 7
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...