flash on 2010-10-5

by yd_niku
♥0 | Line 35 | Modified 2010-10-05 11:57:50 | MIT License
play

ActionScript3 source code

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

package {
    import flash.display.*;
    import jp.progression.commands.*;
    import jp.progression.commands.tweens.*;
    import flash.utils.*;
    public class FlashTest extends Sprite {
        public function FlashTest() {
            // write as3 code here..
            var ball:Sprite = new Ball();
            
            addChild(ball);
            
            var com:Command = new DoTweener(ball, { delay:10, time:5, x:465, y:465 });
            com.execute();
            
            trace('TEST');
            setTimeout(function():void{
                log('TEST');
                com.interrupt();
            },2000);
        }
    }
}

import flash.external.*;
import flash.display.*;

function log(...rest:Array):void{
    trace.apply(null,rest);
}

class Ball extends Sprite{
    public function Ball(){
        draw();
    }
    
    
    private function draw():void{
        this.graphics.clear();
        this.graphics.beginFill(0xff0000,1);
        this.graphics.drawCircle(0,0,20);
        this.graphics.endFill();
    }
}