dot gradation

by keno42
♥0 | Line 21 | Modified 2014-06-05 17:07:38 | MIT License
play

ActionScript3 source code

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

package {
    import flash.display.Sprite;
    import flash.events.*;
    public class FlashTest extends Sprite {
        public function FlashTest() {
            // write as3 code here..
            
            stage.addEventListener("enterFrame", onEnterFrame);
        }
        private var f:Number = 0;
        private function onEnterFrame(e:Event):void{
            f++;
            this.graphics.clear();
            for( var x:int = 0; x < 525; x+= 20) {
                for( var y:int = 0; y < 525; y += 20) {
                    this.graphics.beginFill( 0xFF * 0x10000 + Math.floor(0xFF * stage.mouseX / 525) * 0x100 + Math.floor(0xFF * stage.mouseY / 525));
                    this.graphics.drawCircle(x, y, (525 - y) / ((1.4 + 0.5 * Math.cos(f/10.0)) * 525 / 20));
                    this.graphics.endFill();
                }
            }
        }
    }
}