flash on 2009-6-17

by TmskSt
♥0 | Line 29 | Modified 2009-06-17 01:35:05 | MIT License
play

ActionScript3 source code

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

package {
    import flash.display.Sprite;
    import flash.display.Shape;
	import flash.geom.Point;
	import flash.display.Graphics;
    public class FlashTest extends Sprite {
		private const STRING_RADIUS:int = 2;
		private const STRING_ANGLE:int = 0;
		private const STRING_IPLUS:int = 3;
		private const STAGE_DEFAULT_POINT:Point = new Point(stage.stageWidth * 0.5, stage.stageHeight * 0.5);
		private var color:uint = 0xffffff;
		
		private var stringAngle:int;
		private var string_circle_radius:int = 150;
		private const NUMBER_FULL:int = 10000;
		private const NUMBER_COM:int = 360;
		
		
		public function FlashTest() {
			for (var i:uint = 0; i < NUMBER_FULL; i++){
    			if (!(i % NUMBER_COM)){string_circle_radius -= 8;color = 0xffffff*Math.random();}
				var stringRadian:int = stringAngle * Math.PI / 180;
				var x:int = STAGE_DEFAULT_POINT.x + string_circle_radius * Math.cos(stringRadian);
				var y:int = STAGE_DEFAULT_POINT.y + string_circle_radius * Math.sin(stringRadian);
				stringAngle += STRING_IPLUS;
				
				this.graphics.beginFill(color, .3);
				this.graphics.drawCircle(x, y, STRING_RADIUS);
				this.graphics.endFill();
			}
        }
    }
}