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

forked from: draw_pictures

Get Adobe Flash player
by haradashinya 14 Feb 2010
    Embed
/**
 * Copyright haradashinya ( http://wonderfl.net/user/haradashinya )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/jZRC
 */

// forked from haradashinya's draw_pictures
//  forked from mash's draw demo
package  {
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	public class DrawDemo extends Sprite {
		
		private var is_clicked :Boolean = false;
		private var lastx  :Number = 0;
		private var lasty  :Number = 0;
		
		public function DrawDemo () {
			graphics.lineStyle(334, 0xE7594F );
			stage.addEventListener( MouseEvent.MOUSE_DOWN,function(e :MouseEvent) :void{
				is_clicked = true;
				lastx = mouseX;
				lasty = mouseY;
				graphics.moveTo( lastx , lasty);
			});
			stage.addEventListener( MouseEvent.MOUSE_MOVE,function(e :MouseEvent) :void {
				if	(is_clicked ) {
					graphics.lineTo( mouseX , mouseY);
				}
				lastx = mouseX;
				lasty = mouseY;
			});
			stage.addEventListener( MouseEvent.MOUSE_UP,function(e : MouseEvent) :void{
				is_clicked =false;
			});
			
		}
	}
}