ErrorTest2

by yd_niku forked from ErrorTest (diff: 29)
♥0 | Line 40 | Modified 2009-05-14 14:50:36 | 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/1hPr
 */

// forked from yd_niku's ErrorTest
package {
    import flash.display.*;
    import jp.progression.core.commands.*;
    import jp.progression.commands.*;
    
    public class FlashTest extends Sprite {
        public function FlashTest() {
            // write as3 code here..
            var ball:Sprite = new Ball();
            
            new SerialList( null,
                new Prop( ball, { x:250, y: 250, alpha:0 } ),
                new AddChild( this, ball ),
                
                //Errorを発生するコマンド
                new FadeIn( ball ), // extends SerialList
                new DoTweener( ball, {scaleX:3, scaleY:3, time:2 }  ),
                new DoTweener( ball, { x:100, y: 200, time:3 } ),
                new DoTweener( ball, { alpha:0.0, time:3 } ),
                new RemoveChild( this, ball )
            ).error( function():void{
                //Errorを受け取りつつ、Error以降でとまってほしい
                this.executeComplete();
            } ).execute();
        }
    }
}


import flash.display.*;
import jp.progression.core.commands.*;
import jp.progression.commands.*;

internal class Ball extends Sprite{
    public function Ball(){
        graphics.beginFill(0x99CC66);
        graphics.drawCircle( 0, 0, 10 );
        graphics.endFill();
    }
}

internal class FadeIn extends SerialList{
    public function FadeIn( target:DisplayObject, initObject:Object=null ) {
        super(initObject,
            new DoTweener( target, { alpha:1.0, time:3 } ),
            new DoTweener( target, { x:400, y: 350, time:3 } ),
            new Func( function () :void{ throw new Error("FAILD!!"); } )
        );
    }
}

Forked