forked from: flash

by yun forked from flash (diff: 24)
♥0 | Line 21 | Modified 2010-06-09 17:44:59 | MIT License
play

ActionScript3 source code

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

// forked from yun's flash
package {
    import flash.display.Sprite;
    public class Index extends Sprite {
    		public function Index() {
    			var repeatCount:int = 50;
    			    			
    			for(var i:Number = 0; i < repeatCount; i++){
				var centerX:Number = Math.round(Math.random()*400) + 50;
				var centerY:Number = Math.round(Math.random()*400) + 50;
				var r:Number = Math.ceil(Math.random()*100);
    				addChild(new DrawCircle(centerX, centerY, r));
    			}
    		}
    }
}

import flash.display.Sprite;
class DrawCircle extends Sprite {
	public function DrawCircle(centerX:Number, centerY:Number, r:Number) {
					
    		graphics.lineStyle(2, 0x000000);
    		//graphics.moveTo(centerX+r, centerY);
    		graphics.drawCircle(centerX, centerY, r);
    		/*graphics.curveTo(r+centerX, Math.tan(Math.PI/8)*r+centerY,
    						Math.sin(Math.PI/4)*r+centerX,
    						Math.sin(Math.PI/4)*r+centerY);
    		graphics.curveTo(Math.tan(Math.PI/8)*r+centerX, r+centerY,
    						centerX, r+centerY);
    		graphics.curveTo(-Math.tan(Math.PI/8)*r+centerX, r+centerY,
    						-Math.sin(Math.PI/4)*r+centerX,
    						Math.sin(Math.PI/4)*r+centerY);
    		graphics.curveTo(-r+centerX, Math.tan(Math.PI/8)*r+centerY,
    						-r+centerX, centerY);
    		graphics.curveTo(-r+centerX, -Math.tan(Math.PI/8)*r+centerY,
    						-Math.sin(Math.PI/4)*r+centerX,
    						-Math.sin(Math.PI/4)*r+centerY);
    		graphics.curveTo(-Math.tan(Math.PI/8)*r+centerX, -r+centerY,
    						centerX, -r+centerY);
    		graphics.curveTo(Math.tan(Math.PI/8)*r+centerX, -r+centerY,
    						Math.sin(Math.PI/4)*r+centerX,
    						-Math.sin(Math.PI/4)*r+centerY);
    		graphics.curveTo(r+centerX, -Math.tan(Math.PI/8)*r+centerY,
    						r+centerX, centerY);*/
    }
}