flash on 2010-4-30

by _wonder
♥0 | Line 31 | Modified 2010-04-30 19:47:55 | MIT License
play

ActionScript3 source code

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

package {
    import flash.display.Sprite;
    public class FlashTest extends Sprite {
    		private var radius:int = 180;
    		private var ballRadius:int = 1;
    		private var pos:int = 5;
    		private var posArray:Array = [];
    		
        public function FlashTest() {
            for( var i:int = 0; i < 360; i++){
            		var rad:Number = i * Math.PI / 180;
            		var dx:Number = Math.sin( rad ) * radius;
            		var dy:Number = Math.cos( rad ) * radius;
            		var ball:Ball = new Ball(ballRadius);
            		ball.x = dx + stage.stageWidth / 2;
            		ball.y = dy + stage.stageHeight / 2;
            		addChild( ball );
            		
            		posArray.push( ball );
            }
        }
        
        private function createCircle():void {
        	
        }
    }
}

import flash.display.Sprite;

class Ball extends Sprite {
	public function Ball(radius:int){
		graphics.beginFill(0X000000);
		graphics.drawCircle(0,0,radius);
		graphics.endFill();
	}
}