flash on 2009-10-6

by telcanty
♥0 | Line 28 | Modified 2009-10-06 10:54:13 | MIT License
play

ActionScript3 source code

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

package {
    import flash.display.Sprite;
    public class FlashTest extends Sprite {
        
       public var ballCount:int = 60;
       private var _balls:Array;
        
        public function FlashTest() {
            // create array to place balls into
            _balls = new Array();
          // make new balls and lay them out
            for(var i:int = 0; i < ballCount; i++)
            {
             var new_ball:Ball = new Ball(0xFFFFFFF * Math.random());
                  new_ball.x = i * 10
                  new_ball.y = i *10;
                  addChild(new_ball);
                  _balls.push(new_ball);
            }  
        }
    }
}
import flash.display.Sprite;
class Ball extends Sprite{
    
    private var _size:int = 10;
    
    public function Ball(color:uint = 0xFF0000)
    {
           this.graphics.beginFill(color);
           this.graphics.drawCircle(0,0,_size);
           this.graphics.endFill();
    }
}