// remove any displayObject, irrespective of location (remove a parent from the child etc)
function kill(object:*):void {
 if(object.parent != null){
  var parent:DisplayObjectContainer = object.parent;
  parent.removeChild(object);
 }
}
// remove all contents of a target MovieClip
function burn(target:MovieClip):void {
   while (target.numChildren) target.removeChildAt(0);
}
 
No comments:
Post a Comment