I am having lots of problems with sounds in my movie.
My movie consists of several frames each loading a sound file
The whole movie also has music that I load on the first frame as following:
ActionScript Code:
//create variable to check if sound on for music, voice and sound in general
playSound = true;
playVoice = true;
playMusic = true;
///// initialize variable for sound
if ( playMusic = true) {
myMusic = new Sound();
myMusic.attachSound ("music");
myMusic.start(0,999);
} else if ( playMusic = false) {
myMusic.stop();
}
When each following frame loads, it plays a different sound file loaded as follow:
ActionScript Code:
if ( playVoice = true) {
myVoice = new Sound();
myVoice .loadSound("sound/voice1.mp3", true);
myVoice .start(0, 1);
} else if ( playVoice = false) {
myVoice.stop();
}
I have a button to stop the music with
and the play music button has:
a button to stop voice:
Since the music is a sound object off course if I click the music off button, it also stops the voice.
What I want is the following:
I want to be able to have music and let users decide if they want to play it, to stop it, restart it.
I also want them to decide if they want the voice or not.
How can I manage this? Can I have both music and voice and stop either one or both at will?