Sound Toggle On/Off

Hi

Ok i’ll try not to confuse anyone with what im gonna ask so here goes.

Ive got a button on a layer called ‘toggle’ that allows me to turn some music on and off - the music is in a sepearte movieclip called ‘soundtrack’ on a layer called 'soundtrack - and it works fine.

However if i turn it off, it begins to play again after one of the movieclips called ‘background’ within the site loops??

Below is the ActionScript im using on the button to control the music:

on (release) {
if (music == true) {
music = false;
stopAllSounds();
} else if (music == false) {
music = true;
Soundtrack.gotoAndPlay(1);
}
}

I cant understand why it begins to play again after i’ve turned it off? any help with this would be greatly appreciated!!

also i have a layer named actions that initialises the load sequence to the whole flash movie that has the script:

music = true

again if anyone can help its appreciated

THANX

Ben.

Those lines of code look presentable and allright…

How about the rest of your code though…
Check around and see if there are any lines that restart your music… It could be just looping around and even though you stopped all the sounds… It will restart that sound from another position…

If you have your sound in a movieClip I’d suggest putting as command in the MC code and making it… onEnterFrame (if music == true) this.PlaySound or Stop sound in this… And just use the toggle button to change the actual variable…

Take it easy…
Peace

thanks for getting back to me, i’ll have another look at it.

cheers

ben.