
MovieClip.swapDepths() Method
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
698
|
ActionScript Language Reference
MovieClip.swapDepths() Method
change the graphic layering of an instance in the visual content stack
Flash 5
mc.swapDepths(target)
mc.swapDepths(depth)
Arguments
target A string indicating the path to the movie clip to be swapped with mc. Because
movie clip references are converted to paths when used in a string context,
target can also be a movie clip object reference, as in mc.swapDepths(window2)
versus mc.swapDepths("window2").
depth An integer, between –16384 and 1048575 (inclusive), specifying a level in
mc’s
parent’s clip stack. Higher depths obscure lower depths, so a depth of 6 is in
front of 5, which is in front of 4, and so on. Depths above –1 are reserved for
dynamically generated content; depths from –16383 to –1 (inclusive) are
reserved for author-time content; and depth –16384 is reserved for dynamic
content that appears beneath all author-time content in
mc (e.g., a runtime
background). For important details, see “Movie and Instance Stacking
Order” in Chapter 13.
Description
All movie clip instances in a .swf document reside in a stack that governs the visual layering
of instances in the Player. The stack is structured like a deck of cards; clips in higher posi-
tions in the stack appear in front of clips in lower ...