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.

}<br />

mc_1.onPress = function() {<br />

this.startDrag();<br />

};<br />

mc_1.onRelease = function() {<br />

this.stopDrag();<br />

};<br />

See also<br />

_droptarget (MovieClip._droptarget property), startDrag (MovieClip.startDrag<br />

method), stopDrag function<br />

swapDepths (MovieClip.swapDepths method)<br />

public swapDepths(target:Object) : Void<br />

Swaps the stacking, or depth level (z-order), of this movie clip with the movie clip specified by<br />

the target parameter, or with the movie clip that currently occupies the depth level specified<br />

in the target parameter. Both movie clips must have the same parent movie clip. Swapping<br />

the depth level of movie clips has the effect of moving one movie clip in front of or behind the<br />

other. If a movie clip is tweening when this method is called, the tweening is stopped. .<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 />

target:Object - This parameter can take one of two forms:<br />

■ A number that specifies the depth level where the movie clip is to be placed.<br />

■ A string that specifies the movie clip instance whose depth is swapped with the movie clip<br />

for which the method is being applied. Both movie clips must have the same parent movie<br />

clip.<br />

Example<br />

The following example swaps the stacking order of two movie clip instances. Overlap two<br />

movie clip instances, called myMC1_mc <strong>and</strong> myMC2_mc, on the Stage <strong>and</strong> then add the following<br />

script to the parent Timeline:<br />

myMC1_mc.onRelease = function() {<br />

this.swapDepths(myMC2_mc);<br />

};<br />

myMC2_mc.onRelease = function() {<br />

this.swapDepths(myMC1_mc);<br />

};<br />

MovieClip 469

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

Saved successfully!

Ooh no, something went wrong!