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: F5 Tree Sample

processing samplle の アレ F5MovieClipの場合
Get Adobe Flash player
by nutsu 17 Jan 2009
// forked from nutsu's F5 Tree Sample
// write as3 code here..
// processing samplle の アレ F5MovieClipの場合
package{
    import frocessing.display.F5MovieClip2D;

    [SWF(frameRate="30", backgroundColor="#000000")] 
    public class F5TreeSample2 extends F5MovieClip2D
    {
        private var theta:Number;

        public function F5TreeSample2() 
        {
            super();
            stroke(255,0.5);
        }

        public function draw():void
        {
            var a:Number = (mouseX / stage.stageWidth ) * 90;
            var h:Number = 150 - ( mouseY / stage.stageHeight) * 50;
            theta = radians(a);
            translate(stage.stageWidth*0.5, stage.stageHeight);
            line(0, 0, 0, -h);
            translate(0, -h);
            branch( h*0.9 );
        }

        private function branch( h:Number ):void
        {
            h *= 0.66;
            if (h > 2)
            {
                pushMatrix();
                rotate(theta);
                line(0, 0, 0, -h);
                translate(0, -h); 
                branch(h);       
                popMatrix();
    
                pushMatrix();
                rotate(-theta);
                line(0, 0, 0, -h);
                translate(0, -h);
                branch(h);
                popMatrix();
            }
        }
    }
}