回転ネスト

by awef
♥0 | Line 38 | Modified 2009-04-21 17:46:21 | MIT License
play

ActionScript3 source code

/**
 * Copyright awef ( http://wonderfl.net/user/awef )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/b5VE
 */

package
{
    import flash.display.Sprite;
    
    [SWF(frameRate = "60")]
    
    public class main extends Sprite
    {
        public function main()
        {
            addChild(new ball(stage.stageWidth / 2, stage.stageHeight / 2, 100));
        }
    }
}

import flash.display.Sprite;
import caurina.transitions.Tweener;

class ball extends Sprite
{
    function ball(arg_x:int, arg_y:int, arg_r:uint)
    {
        x = arg_x;
        y = arg_y;
        
        graphics.beginFill(0xFFFFFF);
        graphics.drawCircle(0, 0, arg_r /10 * 8);
        graphics.endFill();
        graphics.beginFill(0);
        graphics.drawCircle(0, arg_r /10 * 2, arg_r /10 * 8);
        graphics.endFill();
        
        run();
        
        if(arg_r >= 10)
        {
            addChild(new ball(0, arg_r /10 * 2, arg_r / 10 * 8))
        }
    }
    
    public function run():void
    {
        rotationZ = 0;
        Tweener.addTween(this, {rotationZ:360, time:4, transition:"linear", onComplete:run});
    }
}

Forked