yoshiweb.NET

トゥイーンの関数を作成するツール

先日もちょっと書いた mx.transitions.Tweenクラス。
import mx.transitions.Tween;
new Tween(ターゲット, プロパティ, イージング関数,開始値, 終了値, フレーム, false);

Tweenクラス のパラメータはこんな感じで、どんな動作になるかは「イージング関数」の部分にどんな関数を入れるかによって変わってくるんだけど、Flashには標準で 6種類の関数しか用意されていない。
自分の好きな動きをつけたい時はその動きにあった関数を書かなきゃいけないけど、そんな トゥイーンの関数を作成してくれるツール

easing_function_generator
http://timotheegroleau.com/Flash/experiments/easing_function_generator.htm

下の黄色い四角、1〜4を動かすと、自動的にトゥイーンに使える関数を書いてくれます。
あとはその function を Tweenクラス のイージング関数を書くところにコピペすれば、好きな動きをスクリプトでできます!
// 例 : test_mc の X座標 を 0〜400 へ30フレームで くねくね移動。
import mx.transitions.Tween;
new Tween(test_mc, "_x", function(t:Number, b:Number, c:Number, d:Number):Number {
var ts:Number=(t/=d)*t;
var tc:Number=ts*t;
return b+c*(37.3425*tc*ts + -106.18*ts*ts + 106.78*tc + -44.39*ts + 7.4475*t);
},0, 400, 30, false);
投稿日 : 2005年10月20日 - yoshiweb - カテゴリ: ActionScript

コメント

投稿者 : buy cialis cheap

Have you ever considered about adding a little bit more than just your articles?
I mean, what you say is fundamental and everything.
However think about if you added some great visuals or videos to give your posts more, "pop"!
Your content is excellent but with images and videos,
this blog could definitely be one of the greatest in its field.
Superb blog!
2023年11月29日 23時06分44秒