Groups | Blog | Home
all groups > flash actionscript > may 2004 >

flash actionscript : How do i control Volume with 2 buttons?



XHossX
5/3/2004 11:04:59 PM
I have a looping sound playing in channel one... i want to be able to control
the sound volume with a Plus and Minus button.. i had the idea of setting a
variable to put in the "sound(1).volume=X-10" but i cant get the syntax
right... Also if it is possible am i able to start and stop the channel one
sound with one button instead of 2?

Hoss
nITiNkIlLeRmEeRuT
5/4/2004 2:20:50 AM
s = new Sound();

on plus button
[b]s.setVolume(s.getVolume()+1);[/b]

on minus button
[b]s.setVolume(s.getVolume()-1);[/b]

XHossX
5/4/2004 5:51:49 AM
where does the s = new Sound(); go??
nITiNkIlLeRmEeRuT
5/4/2004 7:09:53 AM
the frame on which u have buttons.
Place this code on the keyframe. This code is used to load external sound. R u
using any other way of playing sound??

s = new Sound();
s.loadSound("whatever.mp3");
s.start(0,1);
XHossX
5/4/2004 1:30:22 PM
AddThis Social Bookmark Button