AS3 Smart Remove Child
function smartRemoveChild(p:DisplayObject, c:DisplayObject):void{ if (p.contains(c)) p.removeChild(c) }