myPencil.addEventListener(MouseEvent.CLICK, holdPencil);function holdPencil(event:MouseEvent):void{stage.addEventListener(MouseEvent.MOUSE_MOVE, drawing);trace("已单击鼠标");//myPencil.removeEventListener(MouseEvent.CLICK, holdPencil);}function drawing(event:MouseEvent):void{stage.addEventListener(MouseEvent.MOUSE_UP, endDrawing);if (event.buttonDown){var myDot:dot=new dot();myDot.x = mouseX-myDot.width/2;myDot.y = mouseY-myDot.width/2;addChild(myDot);}}function endDrawing(event:MouseEvent):void{stage.removeEventListener(MouseEvent.MOUSE_UP, endDrawing);}
用flashCS6写的制作画板的代码
最新推荐文章于 2022-01-22 14:22:30 发布