Re: [Flashcoders] sound fadeOut

2005-11-08 Thread brian groth
I made this object to take care of this autofade. You init it with the sound mc and update interval i ms. You can then call it with (target volume, length of fade time and delay) Hope you find it usefull: class SoundAuto extends Sound{ private var intervalId:Number private var

[Flashcoders] sound fadeOut

2005-11-07 Thread MetaArt
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;

Re: [Flashcoders] sound fadeOut

2005-11-07 Thread Pascal FODOR
Hi, Here is a Sound prototype I often use. You can also easily set it as a function in a sound class: Sound.prototype.volumeTo=function(nTarget:Number,step:Number,post_func:Funct ion){ var a=nTarget - this.getVolume(); var v=this.getVolume(); var dir=a/Math.abs(a);

Re: [Flashcoders] sound fadeOut

2005-11-07 Thread [EMAIL PROTECTED]
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() {

Re: [Flashcoders] sound fadeOut

2005-11-07 Thread Eric E. Dolecki
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

Re: [Flashcoders] sound fadeOut

2005-11-07 Thread [EMAIL PROTECTED]
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

Re: [Flashcoders] sound fadeOut

2005-11-07 Thread eric dolecki
I guess I'm saying that any audio fading up or down should probably not be done linearly ever - while mathematically accurate, to the human ear it doesn't sound right. You'll notice no change and then zm... a really quick fade down... when what you wanted was something even if you know what I

Re: [Flashcoders] sound fadeOut

2005-11-07 Thread eric dolecki
Basically yes :) Flash has no notion of decibels - there are probably formulas out there to try and approximate that logarithmic curve and apply it to your audio to get a more natural response. Its a interesting topic at least ;) e.dolecki On 11/7/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

[Flashcoders] sound fadeOut: strange behavior

2005-11-07 Thread MetaArt
I have tryed the andreas suggestion, but don't work. The jingle volume continue to be the previous (fadingIn to 90). But the strange news is another: if I do a test movie inside Flash, the sound of jingle is loaded and faded (code below), but if I test within HTML page, no sound is loaded... How

Re: [Flashcoders] sound fadeOut: strange behavior - solved

2005-11-07 Thread MetaArt
Well, I have solved both the problems; 1) for the fadeIn / fadeOut question, I assume this solution: instead that put the loadSound code on main timeline, I have done a new mc, with two frame inside. At the first frame, insert the code below stop(); track = new Sound();