
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Movie and Instance Stacking Order
|
341
other clip (the “lower” of the two). This appears simple enough in principle, but the
main content stack, which contains all the instances and .swf files, is actually divided
into many smaller substacks. We’ll first look at these substacks individually first, and
then we’ll see how they combine to form the main stack. (The content stack in this
discussion has no direct relation to the LIFO and FIFO stacks discussed in
Chapter 11.)
Movie Clip Depths
Each movie clip instance, including the main timeline of a movie, places its various
contents (movie clips, text fields, and buttons) on one of two stacks: the internal
layer stack (for author-time assets) or the programmatically generated content stack
(for runtime assets). The items in these stacks (known collectively as the clip’s con-
tent stack) are given an integer depth position that governs how they overlap on
screen. Depth positions range from –16384 to 1048575. Depths from 0 to 1048575
are reserved for dynamically generated content; depths from –16383 to –1 are
reserved for author-time content; and depth –16384 is reserved for dynamic content
that appears beneath all author-time content in each clip. To retrieve the depth posi-
tion of an item, we use the getDepth() method. To change the depth ...