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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Returns the depth of the movie clip instance.<br />

Each movie clip, button, <strong>and</strong> text field has a unique depth associated with it that determines<br />

how the object appears in front of or in back of other objects. Objects with higher depths<br />

appear in front.<br />

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

Returns<br />

Number - The depth of the movie clip.<br />

Example<br />

The following code traces the depth of all movie clip instances on the Stage:<br />

for (var i in this) {<br />

if (typeof (this[i]) == "movieclip") {<br />

trace("movie clip '"+this[i]._name+"' is at depth "+this[i].getDepth());<br />

}<br />

}<br />

See also<br />

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

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

(MovieClip.swapDepths method), getDepth (TextField.getDepth method), getDepth<br />

(Button.getDepth method)<br />

getInstanceAtDepth (MovieClip.getInstanceAtDepth<br />

method)<br />

public getInstanceAtDepth(depth:Number) : MovieClip<br />

Determines if a particular depth is already occupied by a movie clip. You can use this method<br />

before using MovieClip.attachMovie(), MovieClip.duplicateMovieClip(), or<br />

MovieClip.createEmptyMovieClip() to determine if the depth parameter you want to pass<br />

to any of these methods already contains a movie clip.<br />

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

Parameters<br />

depth:Number - An integer that specifies the depth level to query.<br />

428 ActionScript classes

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

Saved successfully!

Ooh no, something went wrong!