• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Z-sorting

We've come across the concept of z-sorting a few times already in this chapter, and now we can finally discuss it in detail. Once again, z-sorting is the term used to describe the creation of the stacking order of movie clips. If two movie clips are overlapping, of course they can't both be on top. The one on top is said to have a higher depth. You are probably familiar with the concept of depth in Flash, but let's review a little bit and go over a few things you may not know about depths in Flash.

Each timeline in a Flash movie can have up to 16,384 depths, and each depth can hold only one movie clip. When you manually place movie clips in a timeline, they are assigned a depth starting at -16,383. Each additional movie clip manually placed in the timeline has a depth higher than the previous one, with numbers moving closer to 0. When you use ActionScript to create instances of movie clips, you assign them a depth. It is recommended by Macromedia (and is common practice) to assign positive depths to movie clips created with ActionScript. Depth 1 does not have to be filled before depth 2. This means that you can, for instance, use attachMovie() and assign the new movie clip a depth of 2,000,000.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint