[訂正]条件分岐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...
[関連記事]






