Reinit_creative log Reinit_creative log rss

Reinit_creative log

about ActionScript3 and Design memo.

[訂正]条件分岐DoTweener

2009.04.15

前回の条件分岐DoTweenerの記事中のスクリプトは、かなり無駄なことをしていたと判明したので訂正。
var sp:Sprite = new Sprite;
sp.alpha=1;
new SerialList(null,
        function():void
        {
                if (sp.alpha==1) {
                        new SerialList(null,
                                //1st_DoTweener
                               this.parent.insertCommand(
                                         new DoTweener(sp, { alpha:0, time:2 } )
                                );
                        ).execute();
                }
        },
        //2nd_DoTweener
        new DoTweener(sp, { alpha:0, time:3 } )
).execute();
これでok。 Funcコマンドにイベントを追加する必要ナッシングでした。 thisがコマンド自体をさしているので、parentプロパティで親のコマンドにinsertCommandメソッドでDoTweenerを追加するという処理をしています。
あーハズカシ。

update 2010.03.01...

[関連記事]

My Icon

Flash+デザインを仕事としています。
info[at]reinit.info
>>detail

レコメンド

ActionScript3アニメーション

ActionScriptアニメーション

アニメーションに関する基礎が得られる本。
コレを読んで、ASが楽しくなった。