I need a simple solution for my volume slider bar problem, I completed the volume slider bar tut. on kirupa and it works for what i’m doing, but i’d like the volume to default to 70 or 80 instead of 0, so that the music plays when the movie starts. I’m sure this is a simple line of code that i’m overlooking, any help would be appreciated.
Define the “volume” variable within the [font=courier new]load[/font] event:
onClipEvent (load) {
mySound = new Sound();
mySound.loadSound("sound2.mp3", false);
//set the initial volume
_root.volume = 70;
//put the "dragger" movie clip in right position according to the volume
dragger._x = line._width*_root.volume/100;
}
Thanks, I appreciate the welcome. I already have another question though…
There’s two tuts. on Kirupa on how to handle sound, one to build a soundbar and the other on how to build a volume bar. I’m trying to build a soundbar with a volume bar in it with multiple audio files. The soundbar has the audio loop imported into the library and loops alot cleaner than loading the audio file from an external MP3, which has a soundgap at the end of the loop track.
The problem is that my volume bar only references the loaded sound, not the native sound. What’s the best way to control the master volume of the movie, or is there a better way to load a soundloop?? Thanks again for all the help.
Here’s you FLA, I’ve deleted the sound symbol from the Library in order to meet to file size limit.
All you have to is to import the sound into the Library, right-click over the sound symbol, select “Linkage” from the menu, check the “Export for ActionScript”, uncheck the “Export in first frame” box, and make sure that the identifier for your sound is “Infin-calpomat-4672.wav”.