all groups > flash actionscript > november 2004 >
You're in the

flash actionscript

group:

controling volume and sounds that play



controling volume and sounds that play bso_71
11/17/2004 8:15:12 PM
flash actionscript: Can I control the volume of a sound through action script? I have two sounds
playing but I want to be able to stop one at any time while the other sound
continues to play so I can't use the stopAllSounds() How can I do this?
Thanks a lot!!! Brenda S.
Re: controling volume and sounds that play dan the guy
11/17/2004 10:59:37 PM
on Frame 1:
s = new Sound( );
s.attachSound("mysound");
s.setVolume(100);
s.start( 0 , 50000 );

on the frame where you want to turn down the volume:

s.setVolume(50);


50 is the setting of loudness of the volume
Re: controling volume and sounds that play bso_71
11/17/2004 11:18:37 PM
Can I do a fade in and a fade out of this sound?

ThANKS!!!!!!

Re: controling volume and sounds that play bso_71
11/18/2004 12:12:31 AM
Re: controling volume and sounds that play dan the guy
11/19/2004 5:13:07 AM
just paste that exact code as I mentioned - no need to name your sound
anything.
if you want it to fade in & out do the following:
if frame 12 was the where the fade ends-
on frame 7
s.setVolume(100);
on frame 8
s.setVolume(90);
on frame 9
s.setVolume(70);
on frame 10
s.setVolume(50);
on frame 11
s.setVolume(30);
on frame 12
s.setVolume(0);


you can mess around with it on how fast you need it to fade.
peace
AddThis Social Bookmark Button