all groups > flash actionscript > december 2005 >
You're in the

flash actionscript

group:

How to decrease music volume?


How to decrease music volume? NightwareCEO
12/26/2005 10:14:58 PM
flash actionscript:
I'm fairly new to Flash, and I'm wondering if there's a script that i can put
into a frame that will decrease the music volume
%10......

then in the next frame ill decrease it another %10 then finally it will be
mutedand ill just say stop the sound.

can someone help me? Thanx
Re: How to decrease music volume? kglad
12/26/2005 11:32:03 PM
you can control your sound if you use the sound object to instantiate your
sound (music). if your sound is in your library, right click it, click
linkage, tick export for actionscript and give it a linkage id (say sound1).
you can then use:

s1=new Sound();
s1.attachSound("sound1");
s1.start();

to instantiate and start your music. to control its volume use the
setVolume() method of sound objects:

s1.setVolume(50);
Re: How to decrease music volume? TuckerT9
1/9/2006 8:54:00 PM
Can you help me now? I used your method to do this, but what I want to do is
FADE the sound out over about 10 frames. Now I am using a setVolume(100) action
at the first frame and setVolume(0) action at the end of the frame, but that
isn't "fading" it out nicely.


Re: How to decrease music volume? kglad
1/10/2006 3:34:56 AM
remove all your current code related to your sound fade. use:

s1.setVolume(100);
fadeI=setInterval(fadeF,200/fps); //<- use your frames per second instead of
fps
function fadeF(){
s1.setVolume(s1.getVolume()-2);
if(s1.getVolume<=0){
clearInterval(fadeI);
}
}
Re: How to decrease music volume? xinaroyall
6/7/2006 12:00:00 AM
I am also trying to fade out music. I tried to follow what you instructed
above, but it's not working. It just keeps on playing at the same volume. It
almost sounds like it starts playing ontop of itself at one point too. This is
the code I'm using:
s1=new Sound();
s1.attachSound("sound1");
s1.start();
s1.setVolume(100);
fadeI=setInterval(fadeF,600/fps);
function fadeF(){
s1.setVolume(s1.getVolume()-2);
if(s1.getVolume<=0){
clearInterval(fadeI);
}
}
AddThis Social Bookmark Button