View Single Post
Nutrox's Avatar Nutrox Nutrox is online now Super Moderator 17 Creative Assets 2006-11-05 #20 Old  
017 - Removing Non-dynamic Movie Clips
 
Normally you can't use removeMovieClip() on movie clips that you place on the Stage while authoring the movie. However, swap the movie clip depth to a positive value and removeMovieClip() will work fine!

ActionScript Code:
  1. function deleteClip(target:MovieClip):Void {
  2.    var d:Number = target._parent.getNextHighestDepth();
  3.    target.swapDepths(d);
  4.    target.removeMovieClip();
  5. }
  6.  
  7. // myMovieClip is already on the Stage
  8. deleteClip(myMovieClip);