Stop/start button sound plays over itself

Hello Evenyone,

I am new to the forum. I am using a 30 sec sound file. I want it to play when the site starts and turn off when the button is hit.

The sound starts when the site starts up however, the first time the sound off button is hit the sound plays over itself-- like two songs are playing. The second time the button is hit the problem seems to go away.

Here is are the steps and code I used. I would appreciate someone giving me better code to use to create on/off buttons and loading sound or helping me with my existing code.

Did following to sound file:
Selected: Linkage
Selected: Export for Actionscript

Created layer named music
Added the following actionscript in keyframe 1
my_sound = new Sound();
my_sound.attachSound('jazz");
my_sound.start(0,1000);
gotoAndStop(“stop”);

In keyframe 2;
Added a stop();
Added a name for the frame called ‘play’

In keyframe 3:
Added a stop();
Added a name for the frame called ‘stop’

Dragged ‘on’ button to frame 2 with following actionscript:
on (release) {
_root.my_sound.start(0,1000);
_root.gotoAndStop(“stop”);
}

Dragged ‘off’ button to frame 3 with following actionscript:
on (release) {
_root.my_sound.stop();
_root.gotoAndStop(“play”);
}

I would appreciate any help…I’m not too familiar with sound files and how to control them.

Thanks.

Lindaabby