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

flash on 2011-2-6

まともなフラクタルをつくろうとしてたら計算を間違えたのだが、どうしてこうなった
Get Adobe Flash player
by Susisu 06 Feb 2011

    Talk

    makc3d at 07 Feb 2011 02:01
    could use some branching
    Embed
package {
    import flash.display.Sprite;
    public class FlashTest extends Sprite {
        public function FlashTest() {
            addChild(new Test(465/2,465,0,1.75,360000));
            
        }
    }
}
import flash.display.Sprite;
import flash.events.Event;
class Test extends Sprite{
    private var i:int=0;
    private var r:Number=-Math.PI/1.5;
    private var px:Number=0;
    private var py:Number=0;
    private var param:uint;
    public function Test(x:Number,y:Number,rotation:Number,scale:Number,param:uint){
        this.x=x;
        this.y=y;
        this.rotation=rotation;
        this.scaleX=this.scaleY=scale;
        this.param=param; 
        this.graphics.lineStyle(0);
        this.graphics.moveTo(px,py);
        this.addEventListener(Event.ENTER_FRAME,enterFrame);
    }
    private function enterFrame(e:Event):void{
        if(i<20000){
            for(var j:int=0;j<20;j++){
            px+=Math.cos(r);
            py+=Math.sin(r);
            r+=((i*(i+1))/2)*Math.PI/param;
            this.graphics.lineTo(px,py);
            i++;
            }
        }
        else this.removeEventListener(Event.ENTER_FRAME,enterFrame);
    }

}