# AS2 strange attached sound behavior

**URL:** <https://forum.kirupa.com/t/as2-strange-attached-sound-behavior/303151>\
**Category:** flash\
**Created:** [January 14, 2010, 10:40pm UTC](https://forum.kirupa.com/t/as2-strange-attached-sound-behavior/303151 "2010-01-14T22:40:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rrobnett](https://avatars.discourse-cdn.com/v4/letter/r/73ab20/32.png) [@rrobnett](https://forum.kirupa.com/u/rrobnett)\
**Post date:** [January 14, 2010, 10:40pm UTC](https://forum.kirupa.com/t/as2-strange-attached-sound-behavior/303151/1 "2010-01-14T22:40:07Z")

</div>

I am totally stumped, or am I just losing it.

Go to this link [http://www.stonehengeband.com](http://www.stonehengeband.com)

Click on the keyboard menu buttons. The sound attached to the Song List button is very loud and sometimes echoes itself. Even though it is the exact same sound element as the other 3. The setVolume property of the sound object for this button is even set to Zero, so there shouldn’t be any sound at all.

here is the code for all 4 buttons.

```auto
 
//--------------------------Menu--------------------------------------
//songlist button-------------------------------------------------
songlist_btn.onRollOver = function() {
 songlist_btn.gotoAndStop("over");
}
songlist_btn.onRollOut = songlist_btn.onReleaseOutside = function() {
 songlist_btn.gotoAndStop("normal");
}
songlist_btn.onPress = function() {
 songlist_btn.gotoAndStop("press");
}
songlist_btn.onRelease = function() {
 gotoAndStop("songlist");
 var keySound:Sound = new Sound();
  keySound.attachSound("keyboardSound");
  keySound.setVolume(0);
  keySound.start();
 songlist_btn.gotoAndStop("normal");
 loadMovieNum("mp3player.swf" , 99);
 displayReturn(50,118, "songlist");
}

//events button---------------------------------------------------
events_btn.onRollOver = function() {
 events_btn.gotoAndStop("over");
}
events_btn.onRollOut = events_btn.onReleaseOutside = function() {
 events_btn.gotoAndStop("normal");
}
events_btn.onPress = function() {
 events_btn.gotoAndStop("press");
}
events_btn.onRelease = function() {
 gotoAndStop("events");
 var keySound:Sound = new Sound();
  keySound.attachSound("keyboardSound");
  keySound.setVolume(10);
  keySound.start();
 events_btn.gotoAndStop("normal");
 displayReturn(949,118, "events");
 loadMovieNum("calender.swf" , 99);
}
//pictures button-------------------------------------------------
pictures_btn.onRollOver = function() {
 pictures_btn.gotoAndStop("over");
}
pictures_btn.onRollOut = pictures_btn.onReleaseOutside = function() {
 pictures_btn.gotoAndStop("normal");
}
pictures_btn.onPress = function() {
 pictures_btn.gotoAndStop("press");
}
pictures_btn.onRelease = function() {
 gotoAndStop("photos");
 var keySound:Sound = new Sound();
  keySound.attachSound("keyboardSound");
  keySound.setVolume(10);
  keySound.start();
 pictures_btn.gotoAndStop("normal");
 displayReturn(500,118, "pictures");
 loadMovieNum("photo_gallery.swf" , 99);
}
//videos button-------------------------------------------------
videos_btn.onRollOver = function() {
 videos_btn.gotoAndStop("over");
}
videos_btn.onRollOut = videos_btn.onReleaseOutside = function() {
 videos_btn.gotoAndStop("normal");
}
videos_btn.onPress = function() {
 videos_btn.gotoAndStop("press");
}
videos_btn.onRelease = function() {
 gotoAndStop("videos");
 var keySound:Sound = new Sound();
  keySound.attachSound("keyboardSound");
  keySound.setVolume(10);
  keySound.start();
 displayReturn(500,118, "videos");
 videos_btn.gotoAndStop("normal");
 loadMovieNum("video_gallery.swf" , 99);
}

```
