MovieClip.getInstanceAtDepth()
Availability
Flash Player 7.
Usage
my_mc.getInstanceAtDepth(depth:Number) : MovieClip
Parameters
An integer that specifies the depth level to query.
depth
Returns
A reference to the MovieClip instance located at the specified depth, or
movie clip at that depth.
Description
Method; lets you determine if a particular depth is already occupied by a movie clip. You can use
this method before using
MovieClip.createEmptyMovieClip()
any of these methods already contains a movie clip. For more information, see "Managing movie
clip depths" in Using ActionScript in Flash.
You can extend the methods and event handlers of the MovieClip class by creating a subclass. For
more information, see "Assigning a class to a movie clip symbol" in Using ActionScript in Flash.
Example
The following example displays the depth occupied by the
Output panel:
this.createEmptyMovieClip("logo_mc", 1);
logo_mc.loadMovie("http://www.macromedia.com/devnet/mx/blueprint/articles/
nielsen/spotlight_jnielsen.jpg");
trace(this.getInstanceAtDepth(1)); // output: _level0.logo_mc
See also
MovieClip.getDepth(), MovieClip.getNextHighestDepth(),
522
Chapter 2: ActionScript Language Reference
MovieClip.attachMovie()
to determine if the depth parameter you want to pass to
undefined
,
MovieClip.duplicateMovieClip()
movie clip instance in the
logo_mc
MovieClip.swapDepths()
if there is no
, or
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?
Questions and answers