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

うずまき

Get Adobe Flash player
by YasSo 18 Dec 2008
    Embed
// write as3 code here..
package {
    import flash.display.Sprite;
    import flash.events.Event;

    [SWF(backgroundcolor="#FFFFFF")]

    public class Test extends Sprite {
        private var center_x:Number;
        private var center_y:Number;
        private var n:Number;

        public function Test() {
            addEventListener(Event.ADDED_TO_STAGE, init);
        }
        
        private function init(e:Event):void {
            center_x = stage.stageWidth/2;
            center_y = stage.stageHeight/2;
            addEventListener("enterFrame", draw);
            n = 0;
        }

        private function draw(e:Event):void {
            this.graphics.clear();
            this.graphics.lineStyle(1, 0x0000ff);
            if (++n >= 360) n = 0;
            for (var r:Number = 0; r <= 360; r++) {
                var x:Number = Math.cos(r*3.14/180*n)*r/2;
                var y:Number = Math.sin(r*3.14/180*n)*r/2;
                if (r == 0) this.graphics.moveTo(x+center_x, y+center_y);
                this.graphics.lineTo(x+center_x, y+center_y);
            }
        }
    }
}