flash on 2010-2-14

by hacker_9p8x8mco
♥0 | Line 25 | Modified 2010-02-14 23:55:48 | MIT License
play

ActionScript3 source code

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

package{
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.geom.Point;

	[SWF(width=465,height=465,backgroundColor=0xFFFFFF,frameRate=60)]
	public class Test extends Sprite{
		public function Test(){
			addEventListener(Event.ADDED_TO_STAGE,init);
		}
		private function init(e:Event):void{
			removeEventListener(Event.ADDED_TO_STAGE,init);
			drawLine(stage.stageWidth * .2,stage.stageHeight * .5,15,0);
		}

		private function drawLine(x:Number,y:Number,n:Number,a:Number):void{
			if(n < 0) return;
			this.graphics.lineStyle(-1,0x000000);
			this.graphics.moveTo(x,y);
			x += Math.cos(a) * n * 3;
			y += Math.sin(a) * n * 3;
			this.graphics.lineTo(x,y);
			drawLine(x,y,--n,a + (20) / 180 * Math.PI);
			drawLine(x,y,--n,a + (-80) / 180 * Math.PI);
		}

	}
}