//建立形狀 var myShape:Shape = new Shape(); //繪出形狀,畫圓drawCircle(x,y,半徑) myShape.graphics.beginFill(0xff0000); myShape.graphics.drawCircle(80,80,80); myShape.graphics.endFill(); //顯示形狀 addChild(myShape); remove_btn.addEventListener(MouseEvent.CLICK, removeHandler); function removeHandler(e:MouseEvent):void{ if(!contains(myShape)){ addChild(myShape); }else{ removeChild(myShape); } }