Swapdepths (Movieclip.swapdepths Method) - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

See also
_droptarget (MovieClip._droptarget property)
,
method)
stopDrag function

swapDepths (MovieClip.swapDepths method)

public swapDepths(target:Object) : Void
Swaps the stacking, or depth level (z-order), of this movie clip with the movie clip specified by
the
parameter, or with the movie clip that currently occupies the depth level specified
target
in the
parameter. Both movie clips must have the same parent movie clip. Swapping
target
the depth level of movie clips has the effect of moving one movie clip in front of or behind the
other. If a movie clip is tweening when this method is called, the tweening is stopped. .
You can extend the methods and event handlers of the MovieClip class by creating a subclass.
Availability: ActionScript 1.0; Flash Lite 2.0
Parameters
- This parameter can take one of two forms:
target:Object
A number that specifies the depth level where the movie clip is to be placed.
A string that specifies the movie clip instance whose depth is swapped with the movie clip
for which the method is being applied. Both movie clips must have the same parent
movie clip.
Example
The following example swaps the stacking order of two movie clip instances. Overlap two
movie clip instances, called
script to the parent Timeline:
myMC1_mc.onRelease = function() {
this.swapDepths(myMC2_mc);
};
myMC2_mc.onRelease = function() {
this.swapDepths(myMC1_mc);
};
See also
,
_level property
getDepth (MovieClip.getDepth method)
(MovieClip.getInstanceAtDepth method)
(MovieClip.getNextHighestDepth method)
and
myMC1_mc
myMC2_mc
,
getNextHighestDepth
,
startDrag (MovieClip.startDrag
, on the Stage and then add the following
,
getInstanceAtDepth
MovieClip
515

Advertisement

Table of Contents
loading

Table of Contents