forked from: Progressoin4 CommandTest

by vasari forked from Progressoin4 CommandTest (diff: 1)
♥0 | Line 58 | Modified 2009-10-15 03:04:21 | MIT License
play

ActionScript3 source code

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

// forked from yd_niku's Progressoin4 CommandTest
package {
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import jp.progression.commands.*;
    import jp.progression.commands.display.*;
    import jp.progression.commands.lists.*;
    import jp.progression.commands.managers.*;
    import jp.progression.commands.media.*;
    import jp.progression.commands.net.*;
    import jp.progression.commands.tweens.*;
    
    public class FlashTest extends Sprite {
        private var ballNormal:Sprite = new Ball(0x993300);
        private var ballShorthand:Sprite = new Ball(0x006699);
        public function FlashTest() {
            normal();
            shorthand();
            //stage.addEventListener( MouseEvent.CLICK, click );
        }
        private function click( e:MouseEvent ):void {
            normal();
            shorthand();
        }
        public function normal():void{
            var com:Command = new SerialList( null,
                new Prop( ballNormal, { x:150,y:100, alpha:0 } ),
                new AddChild( this, ballNormal),
                new DoTweener( ballNormal, { alpha:1, time:2 } ),
                new Wait( 3 ),
                new DoTweener( ballNormal, { x: 300, y:300, time:2 } ),
                new Wait( 0,5 ),
                new DoTweener( ballNormal, { alpha: 0, time:5 } ),
                new Trace( "Finish!", ballNormal )
            );
            com.execute();    
        }
        public function shorthand():void{
            var com:Command = new SerialList( null,
                new Prop( ballShorthand, { x:350,y:100, alpha:0 } ),
                new AddChild( this, ballShorthand),
                new DoTweener( ballShorthand, { alpha:1, time:2 } ),
                3,
                new DoTweener( ballShorthand, { x: 300, y:300, time:2 } ),
                0.5,
                new DoTweener( ballShorthand, { alpha: 0, time:5 } ),
                "Finish!", ballShorthand
            );
            com.execute();    
        }
    }
}
import flash.display.Sprite;
class Ball extends Sprite{
    public function Ball(color:uint) {
        graphics.beginFill( color );
        graphics.drawCircle( 0, 0, 20  );
        graphics.endFill();
    }
}