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

spiral2

Get Adobe Flash player
by Scmiz 17 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/vtTv
 */

// forked from Scmiz's spiral
package {
	import flash.display.Graphics;
    import flash.display.Sprite;
	import flash.events.Event;
    public class FlashTest extends Sprite {
        public function FlashTest() {
			this.graphics.beginFill(0x000000);
			this.graphics.drawRect(0, 0, 465, 465);
			this.graphics.endFill();
			
			var sprite:Sprite = new Sprite();
			sprite.x = 232.5;
			sprite.y = 232.5;
			this.addChild(sprite);
            
			var colors:Array = new Array(0xff8080, 0x80ff80, 0x8080ff);
			
			for (var outdex:uint = 0; outdex < colors.length; ++outdex) {
				var g:Graphics = sprite.graphics;
				g.lineStyle(5, colors[outdex]);
				g.moveTo(0, 0);
				
				var rad:Number = Math.PI * 2 * (outdex / colors.length);
				var radius:Number = 0;
				
				var radSpeed:Number = Math.PI * 2 / 6;
				var radiusSpeed:Number = 10;

				for (var index:uint = 0; index < 40; ++index) {
					g.lineTo(
						Math.cos(rad + (radSpeed)) * (radius + (radiusSpeed)),
						
						Math.sin(rad + (radSpeed)) * (radius + (radiusSpeed)));
					
					rad += radSpeed;
					radius += radiusSpeed;
				}
			}
			
			var proc:Function = function(e:Event):void {
				sprite.rotationZ -= 2;
			}
			this.addEventListener(Event.ENTER_FRAME, proc);
        }
    }
}