【完成】ステージをクリックするたびに線を引く

by koutan
♥2 | Line 19 | Modified 2009-06-19 22:32:04 | MIT License
play

ActionScript3 source code

/**
 * Copyright koutan ( http://wonderfl.net/user/koutan )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/wI1B
 */

package {
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	import flash.filters.DropShadowFilter;
 [SWF(width=465, height=465, frameRate=60, backgroundColor=0x000000)]
	public class wonderfl extends Sprite
	{

		public function wonderfl()
		{
			
			//線を描く
			graphics.lineStyle(3,Math.random()*0xffffff);
			graphics.lineTo(20,100);
			
			//ステージにクリックイベントを作成する。
			stage.addEventListener(MouseEvent.CLICK,onClick);
						
		}
		
		//ステージクリックイベント
		public function onClick(e:MouseEvent):void{
			
			graphics.lineStyle(Math.random()*10,Math.random()*0xffffff);
			graphics.lineTo(mouseX,mouseY);
			
			
		}
		
		
		
	}
}

Forked