getInstanceAtDepth (MovieClip.getInstanceAtDepth
method)
public getInstanceAtDepth(depth:Number) : MovieClip
Determines if a particular depth is already occupied by a movie clip. You can use this method
before using
MovieClip.attachMovie()
MovieClip.createEmptyMovieClip()
to any of these methods already contains a movie clip.
You can extend the methods and event handlers of the MovieClip class by creating a subclass.
Availability: ActionScript 1.0; Flash Player 7
Parameters
- An integer that specifies the depth level to query.
depth:Number
Returns
- A reference to the MovieClip instance located at the specified depth, or
MovieClip
if there is no movie clip at that depth.
undefined
Example
The following example displays the depth occupied by the
the Output panel:
this.createEmptyMovieClip("triangle", 1);
triangle.beginFill(0x0000FF, 100);
triangle.moveTo(100, 100);
triangle.lineTo(100, 150);
triangle.lineTo(150, 100);
triangle.lineTo(100, 100);
trace(this.getInstanceAtDepth(1)); // output: _level0.triangle
See also
attachMovie (MovieClip.attachMovie method)
(MovieClip.duplicateMovieClip method)
(MovieClip.createEmptyMovieClip method)
,
method)
getNextHighestDepth (MovieClip.getNextHighestDepth method)
swapDepths (MovieClip.swapDepths method)
866
ActionScript classes
,
MovieClip.duplicateMovieClip()
to determine if the depth parameter you want to pass
triangle
,
duplicateMovieClip
,
createEmptyMovieClip
,
getDepth (MovieClip.getDepth
, or
movie clip instance in
,
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?