function loadshui(e:MouseEvent ) { var myshui=new shui(); myshui.x=mouseX+50.4; myshui.y=mouseY+15.2; myshui.addEventListener(Event.ENTER_FRAME,remove); stage.addChild(myshui); } function remove(e:Event) { if (e.target.currentFrame==65) { trace(e.target); e.target.parent.removeChild(e.target) } } //if(parent) parent.removeChild(this);