In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

forked from: psychedelic

Get Adobe Flash player
by yaodayizi 04 May 2011
/**
 * Copyright yaodayizi ( http://wonderfl.net/user/yaodayizi )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/rlAP
 */

// forked from Scmiz's psychedelic
package {
    import flash.display.Sprite;
    import flash.events.Event;
    public class FlashTest extends Sprite {
        private var _sprite:Sprite = new Sprite();
        private var _array:/*uint*/Array = new Array();
        private var _frame:uint = 0;

        public function FlashTest() {
            _sprite.x = 232.5;
            _sprite.y = 232.5;
            this.addChild(_sprite);
            this.addEventListener(Event.ENTER_FRAME, proc);
        }
        
        private function proc(e:Event):void {
                ++_frame;
                if (_frame >= 1) {
                    _frame = 0;
                    var r:uint = (Math.random() * 256);
                    var g:uint = (Math.random() * 256);
                    var b:uint =  (Math.random() *256);
                    var color:uint = (r << 16) + (g << 8) + (b << 0);
                    _array.push(color);
                    if (_array.length > 120) {
                        _array.splice(0, 1);
                    }
                    
                    _sprite.graphics.clear();
                    var centerX:Number = 0 ;
                    var centerY:Number = 0;
                    for (var index:uint = 0; index < _array.length; ++index) {
                        var size:Number = (_array.length - index) * 3;
                        var cx:Number = centerX +  Math.sin(index)*2;
                        var cy:Number = centerY +  Math.cos(index)*2;
                        _sprite.graphics.beginFill(_array[index]);
                        //_sprite.graphics.drawRoundRect(centerX - (size / 2), centerY - (size / 2), size, size, size / 4, size / 4);

                        _sprite.graphics.drawCircle(cx , cy, size / 2)

                            //_sprite.graphics.drawCircle(centerX -size , centerY - size, size / 2);

                        _sprite.graphics.endFill();
                    }
                    _sprite.rotationZ+= 1;
                }
            };
    }
}