PDA

View Full Version : Script for controlling volume of entire movie?


ToddziLLa
11-22-2002, 03:00 PM
Flash 5: I am making a children's game with tons of different buttons that make different sounds. I would like to make two buttons (up and down, respectively) that control ALL sounds in the movie, not just one sound. Is there a script that I can do that with? Thanks for any suggestions.

spacether
11-22-2002, 05:48 PM
I don't know how to adjust the volume of the entire movie, but I know a way to adjust the volume of every sound to what you want, therefore adjusting the volume of the movie:

soundarray = newarray[sound1, sound2, sound3];
for (i=1; i < soundarray.length; i++){
_root.soundarray[i].Setvolume(vol);
}

*comment: copying this code wont work, i just tried to show the ideas. Make an array of all your sounds, this assumes that they are all on the main stage of your movie so _root.soundarray[i] points to the sound. Then the for loop sets the volume of each sound to whatever your vol variable is. Hope this helps.