Hi,
I have made an animation of a garden and i want the garden sound to play until the user clicks a certain tomato which starts a sequence to the next scene - then i want to sound to fade out to mute.
sooo… i want to fade in a sound when the animation starts then fade out when the user click a button.
i attach a .fla of my rough set up… the isnt a sound on there as my garden sound made the .fla to big to upload.
i also found this code on here but don’t really know how to apply it or if it is the right thing:
[COLOR=DarkGreen]import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
var myTransform=SoundMixer.soundTransform;
var myTween:Tween;
myButton.addEventListener(MouseEvent.CLICK, toggleMute);
function toggleMute(evt) {
if (SoundMixer.soundTransform.volume==1) {
myTween=new Tween(myTransform, “volume”, None.easeNone, 1, 0, 3, true);
myTween.addEventListener(TweenEvent.MOTION_CHANGE, changeVolume);
} else {
myTween.stop();
myTransform.volume=1;
SoundMixer.soundTransform=myTransform;
}
}
function changeVolume(evt) {
SoundMixer.soundTransform=myTransform;
}[/COLOR]
thank you very much for any help!
Kira