Tweenerで音量をトゥイーンさせる
自分用のメモ。サウンドの音量をトゥイーンさせるには、SoundShortcutsクラスをインポートしてinit()で初期化してから使う。Tweenerの対象オブジェクトはSoundChannel型の変数にする。音量を変化させたいときは_sound_volumeプロパティ、音量をパンさせたい時は_sound_panプロパティをそれぞれ弄くる。
ACTIONSCRIPT:
import caurina.transitions.Tweener;
import caurina.transitions.properties.SoundShortcuts;
import caurina.transitions.properties.SoundShortcuts;
SoundShortcuts.init();
var bgm:Sound = new soundBgm();
var channel:SoundChannel = bgm.play(0);
Tweener.addTween(channel, {_sound_volume:0, time:1, transition:"linear"});
Hello Simo,
Just to share with you my sound fade method with TweenLite :
TweenLite explain/download -> http://blog.greensock.com/tweenliteas3/
See you next’
PS: Have you tested rightToRight and leftToLeft SoundTransform properties? Really interesting for pan FX.
Hello Adrien!
Thank you for sharing TweenLite. I have never used TweenLite, but the usage is almost the same. It is happy to make the sound done in tween!