If you want to keep things simple, and the volume fade doesn't need to be linear, couldn't you just run a soundUpdate function and keep track of the volume in a variable. something like this:

var volume = 0;
var destVolume = 100;

setInterval(soundUpdate, 100);

function soundUpdate() {
        volume += (destVolume - volume) / 20;
        track.setVolume(volume);
}

then when you need the volume to change you could just do:

on (rollOver) {
        destVolume = 0;
}

then maybe add another interval that sets destVolume back to 100. you could probably replace the "volume += (destVolume .." with something better but at least it should work. :)

Andreas

MetaArt wrote:
In my movie, I have a jingle, that is loaded by this code:

code:-----------------------------------------------------------------------
-------track = new Sound();
track.loadSound("everybody.mp3", true);
track.setVolume(0);
vol = 0;
fade = setInterval(fadeIn, 100);
function fadeIn() {
vol += 1;
track.setVolume(vol);
if (vol>=90) {
clearInterval(fade);
}
};--------------------------------------------------------------------------
----
during playback of this jingle, is possible that happens an event (a
rollOver action) by the user that start the playback of an other audio file,
this time a talkin' human voice.
The problem is that the jingle cover the voice, or whatever the two audios
overlaps.
Therefore, I want do something that, on rollOver, do the jingle has a fast
fadeOut, starting by the volume level where it is.
How can I obtain this?


     Enrico Tomaselli
  +> web designer <+
  [EMAIL PROTECTED]
http://www.metatad.it

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to