so then the code here would work since it's not "linear".

but i'm not sure what you mean by "linear adjustments prove to sound highly inaccurate"? in this case i don't think it matters anyway since it's just a small change of volume and he's probably not coding some online dj mixing software. or maybe he is.. :)

andreas


Eric E. Dolecki wrote:
I've found that linear adjustments prove to sound highly inaccurate - or strange. You'll notice no difference, and then the change will be quite abrupt. So be careful with these kinds of things - linear is probably not the best way to go.

e.dolecki


On Nov 7, 2005, at 5:21 AM, [EMAIL PROTECTED] wrote:

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

_______________________________________________
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