• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 7. Controlling the Movie Clip > Controlling Movie Clip Depth Levels

Controlling Movie Clip Depth Levels

When you have multiple draggable movie clips, you’ll notice that the objects maintain their stacking order even while they’re being dragged, which can seem a little odd. You would expect that the one you pick up would come to the top. You can make it do so by using the swapDepths() method to swap the stacking order of movie clips dynamically. swapDepths() can switch the stacking order of movie clips either by swapping two named movie clips or by swapping a named movie clip with whatever movie clip is in a designated depth level. The depth level is a number that refers to a movie clip’s stacking order. Higher depth-level numbers will overlap lower ones, much like levels of loaded movies.

The amazing thing about swapDepths() is that it even works across layers, so a movie clip in the bottom layer can swap with a movie clip in the top layer.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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