Attach sound problem

I am having problems playing my loop i have a play and stop button my movie is 1 keyframe long.

On frame one I have the following actionscript:

mySound = new Sound();
mySound.attachSound(“bgSound”);
mySound.start(0, 999);
// loop 999 times

On the ON button I have

on (release) {
if (playing != true) {
mySound.start(0, 999);
playing = true;
}
}

On the OFF Button I have

on (release) {
mySound.stop();
}

There are 2 problems, when I stop and play the sound 2 times after 2 times it wont play.

The other problem happens when I press on play it plays on top of the sound and messes it up completely, can anyone correct the actionscript so it wont play on top of the sound, and it will play everytime the user clicks stop and play. Im posting the SWF File so you will get a picture of what I mean. Thanks alot for your help.

http://www.artek-design.com/sound.swf

[AS]mySound = new Sound();
mySound.attachSound(“bgSound”);
mySound.start(0, 999);
playing = true;
//
on (release) {
if (!playing) {
mySound.start(0, 999);
playing = true;
}
}
//
on (release) {
if (playing) {
mySound.stop();
playing = false;
}
}[/AS]

OK THanks Kax got it.

You’re welcome. =)