Welcome to the new How To Gurus Blog

Where you can always find my latest Demos and YouTube Videos. You will find samples taken from my Training DVDs and also exclusive videos created specifically for my online audience.

Thursday, August 21, 2008

Sound Controls using ActionScript

Question:
I installed a instrumental drum music on stage from the
library in flash CS2 and a layer of 2 buttons on the stage named "sound
on" and "sound off". I cannot get the correct scripting for shutting off
and on when pressing the relative buttons. I have also asked a few friends
and no luck. Please help. I have the music on "loop" and "stream".


Answer:
The function you want to use is setVolume()

For no sound it should look like this setVolume(0)
For full sound it should look like this setVolume(100)

With the number being the percentage of sound.