In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

お絵描き

Get Adobe Flash player
by d4_1977 02 Jan 2010
/**
 * Copyright d4_1977 ( http://wonderfl.net/user/d4_1977 )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/di9d
 */

package {
	import flash.display.Sprite;
	import flash.events.*;
	import flash.text.*;

	public class DrawTest extends Sprite{         
		public var canvas:Sprite = new Sprite();
		public function DrawTest(){
			canvas.graphics.beginFill(0xe7e7e7);
			canvas.graphics.drawRect(10,10,300,300);
			canvas.graphics.endFill();

			addChild(canvas);
			canvas.addEventListener(MouseEvent.MOUSE_MOVE, drawHandler)
		}

		public function drawHandler(events:MouseEvent):void{
			canvas.graphics.lineStyle(1, 0xcc0000);
			canvas.graphics.lineTo(events.stageX,events.stageY);

			var tf:TextField = new TextField();
			tf.text = events.stageX + ' : ' + events.stageY;
		}
  }
}