SWiSH Player Support
SWF5 or later - Supported Internally
Syntax
mySprite.swapDepths(depth)
mySprite.swapDepths(target)
Arguments
depth: an integer used to determine the depth at which the specified Sprite will be moved to.
target: the target to be swapped with the specified Sprite (mySprite).
Returns
Nothing.
Description
Method; used to swap the depth level of the specified Sprite with either another movie (target argument) or a specified depth (depth argument). If another movie resides at the depth level specified, the depth level of both instances will be swapped.
Note: It is required that both instances have the same parent Sprite.
Sample
onFrame(10) {
mySprite1.swapDepths(20); // moves mySprite1 to a depth level of 20
}
onFrame(10) {
mySprite1.swapDepths(mySprite2); // swaps the depth level of mySprite1 with mySprite2
}
See Also
getDepth()