# Sound overlap in music on/off button

**URL:** <https://forum.kirupa.com/t/sound-overlap-in-music-on-off-button/299391>\
**Category:** Uncategorized\
**Created:** [November 4, 2009, 9:46am UTC](https://forum.kirupa.com/t/sound-overlap-in-music-on-off-button/299391 "2009-11-04T09:46:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![micheed](https://avatars.discourse-cdn.com/v4/letter/m/cc9497/32.png) [@micheed](https://forum.kirupa.com/u/micheed)\
**Post date:** [November 4, 2009, 9:46am UTC](https://forum.kirupa.com/t/sound-overlap-in-music-on-off-button/299391/1 "2009-11-04T09:46:32Z")

</div>

I’m making a website for a school project.  
The problem I’m having is everytime I click on the home button it goes back to the first frame and replays the music, it overlaps which is very annoying and the buttons are made unclickable. Here is a link to my site [http://dmgradproj.com/wastedart/flashwebsite\_v17.html](http://dmgradproj.com/wastedart/flashwebsite_v17.html)

The AS2 code i used was

bgSound = new Sound(this);  
bgSound.attachSound(“sound 2”);  
bgSound.start(0, 99);  
playB.enabled=false;  
slider.slideBar.\_y = -30;  
slider.slideBar.onEnterFrame = function() {  
bgSound.setVolume(0-this.\_y);  
};  
slider.slideBar.onPress = function() {  
startDrag(this, false, this.\_x, -65, this.\_x, 0);  
};  
slider.slideBar.onRelease = slider.slideBar.onReleaseOutside=function () {  
stopDrag();  
};  
stopB.onRelease = function() {  
bgSound.stop();  
playB.enabled=true;  
stopB.enabled=false;  
};  
playB.onRelease = function() {  
bgSound.start(0, 99);  
playB.enabled=false;  
stopB.enabled=true;  
};  
stop();

I really need help as this is due tomorrow afternoon
