Volume slider bug?

Hello

I’m pretty new to actionscript coding and i’m attempting to make a volume slider for my website.

I have it working from the tutorial on this site but it has a bug.

When you click the play button it plays the sound but if you click it again it plays it again without stopping the previous one. This means i could have two instances of the same soundplaying.

I’d also like to know if it’s possible to get the sound to play as soon as its loaded, so the user doesn’t have to press the play button.

thanks

Herbiegrey