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

psychedelic

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

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 = 192 + (Math.random() * 64);
					var g:uint = 192 + (Math.random() * 64);
					var b:uint = 192 + (Math.random() * 64);
					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) * 8;
						_sprite.graphics.beginFill(_array[index]);
						_sprite.graphics.drawRoundRect(centerX - (size / 2), centerY - (size / 2), size, size, size / 4, size / 4);
						_sprite.graphics.endFill();
					}
					_sprite.rotationZ += 1.0;
				}
			};
    }
}