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<br />

Number - An integer that reflects the next available depth index that would render above all<br />

other objects on the same level <strong>and</strong> layer within the movie clip.<br />

Example<br />

The following example draws thre movie clip instances, using the getNextHighestDepth()<br />

method as the depth parameter of the createEmptyMovieClip() method, <strong>and</strong> labels each<br />

movie clip them with its depth:<br />

for (i = 0; i < 3; i++) {<br />

drawClip(i);<br />

}<br />

function drawClip(n:Number):Void {<br />

this.createEmptyMovieClip("triangle" + n, this.getNextHighestDepth());<br />

var mc:MovieClip = eval("triangle" + n);<br />

mc.beginFill(0x00aaFF, 100);<br />

mc.lineStyle(4, 0xFF0000, 100);<br />

mc.moveTo(0, 0);<br />

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

mc.lineTo(0, 100);<br />

mc.lineTo(0, 0);<br />

mc._x = n * 30;<br />

mc._y = n * 50<br />

mc.createTextField("label", this.getNextHighestDepth(), 20, 50, 200, 200)<br />

mc.label.text = mc.getDepth();<br />

}<br />

See also<br />

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

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

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

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

(MovieClip.createEmptyMovieClip method)<br />

getSWFVersion (MovieClip.getSWFVersion<br />

method)<br />

public getSWFVersion() : Number<br />

Returns an integer that indicates the Flash Player version for the movie clip was published. If<br />

the movie clip is a JPEG, GIF, or PNG file, or if an error occurs <strong>and</strong> Flash can't determine the<br />

SWF version of the movie clip, -1 is 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 />

430 ActionScript classes

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

Saved successfully!

Ooh no, something went wrong!