03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Returns<br />

MovieClip - A reference to the MovieClip instance located at the specified depth, or<br />

undefined if there is no movie clip at that depth.<br />

Example<br />

The following example displays the depth occupied by the triangle movie clip instance in<br />

the Output panel:<br />

this.createEmptyMovieClip("triangle", 1);<br />

triangle.beginFill(0x0000FF, 100);<br />

triangle.moveTo(100, 100);<br />

triangle.lineTo(100, 150);<br />

triangle.lineTo(150, 100);<br />

triangle.lineTo(100, 100);<br />

trace(this.getInstanceAtDepth(1)); // output: _level0.triangle<br />

See also<br />

attachMovie (MovieClip.attachMovie method), duplicateMovieClip<br />

(MovieClip.duplicateMovieClip method), createEmptyMovieClip<br />

(MovieClip.createEmptyMovieClip method), getDepth (MovieClip.getDepth<br />

method), getNextHighestDepth (MovieClip.getNextHighestDepth method),<br />

swapDepths (MovieClip.swapDepths method)<br />

getNextHighestDepth<br />

(MovieClip.getNextHighestDepth method)<br />

public getNextHighestDepth() : Number<br />

Determines a depth value that you can pass to MovieClip.attachMovie(),<br />

MovieClip.duplicateMovieClip(), or MovieClip.createEmptyMovieClip() to ensure<br />

that Flash renders the movie clip in front of all other objects on the same level <strong>and</strong> layer in the<br />

current movie clip. The value returned is 0 or higher (that is, negative numbers are not<br />

returned).<br />

You can extend the methods <strong>and</strong> event h<strong>and</strong>lers of the MovieClip class by creating a subclass.<br />

Note: You should not use this method if you are also using V2 components. If you placed a V2<br />

component either on the stage or in the library, the getNextHighestDepth() method returns<br />

depth 1048676, which is outside the valid range. This can prevent successful calls to<br />

MovieClip.removeMovieClip().<br />

MovieClip 429

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!