Give attached MovieClips unique names and depths
Give MovieClip instances unique depths and unique names to avoid accidentally overwriting other MovieClip instances.
Bugs that occur because of this phenomenon can be very hard to track down.
I introduced a bug in a game I was building once my not giving an element a unique name. The game had a number of levels with elements on a board. I named each element ‘_element1’,’_element2’,’_element3’ etc. There number represented their depth so I thought they would be unique. As the user plays the game the elements animate off but as soon as the animation is complete the movieClip is removed. This was done by including an onComplete call within the Tweener class I was using. However when next level starts the Tweener still contained the reference to a movieClip with the name ‘_element1’ so for no apparent reason ‘_element1’ was being removed.
The easiest way to ensure this is to have all your MovieClip classes extend a single class something like BasicMovieClip and then include a static counter that is added to every time a new MovieClip is created.
Comment on Page
If anything is unclear or just plain wrong let us know and should ammend it pretty sharpish. If you visited the page with a particular question leave it and if it's flash related I'll try to answer it.