package { import flash.display.Sprite; import flash.events.MouseEvent; public class essai extends Sprite { private var Layer:Sprite=new Sprite() public function essai() { Layer.graphics.beginFill(0x00FF00); Layer.graphics.drawRect(50,50,100,100); addChild(Layer); graphics.beginFill(0xFF0000); graphics.drawCircle( 100, 100, 100 ); stage.addEventListener(MouseEvent.MOUSE_MOVE, draw); stage.addEventListener(MouseEvent.CLICK,erase); } public function erase(event:MouseEvent):void { removeChild(Layer); } public function draw(event:MouseEvent):void { graphics.beginFill(Math.random() * 0xFFFFFF); graphics.drawCircle( mouseX, mouseY, Math.random()*10 ); } } } flash on 2009-5-11