# Adding sound on MOUSE\_OVER

**URL:** <https://forum.kirupa.com/t/adding-sound-on-mouse-over/300315>\
**Category:** Uncategorized\
**Created:** [November 19, 2009, 2:35am UTC](https://forum.kirupa.com/t/adding-sound-on-mouse-over/300315 "2009-11-19T02:35:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daimz](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/daimz/32/2383_2.png) [@Daimz](https://forum.kirupa.com/u/Daimz)\
**Post date:** [November 19, 2009, 2:35am UTC](https://forum.kirupa.com/t/adding-sound-on-mouse-over/300315/1 "2009-11-19T02:35:56Z")

</div>

how can I add sound to a button on rollover?

I have tried this but the sound plays when the page is loaded aswell as when ouse over.

```auto
var aboutBtnsnd:Sound = new Sound(new URLRequest("clook.mp3"));
var aboutBtnchannel:SoundChannel = aboutBtnsnd.play();
var aboutBtnpausePosition:int = aboutBtnchannel.position;

Nav.aboutBtn.addEventListener(MouseEvent.MOUSE_OVER, aboutBtnstartSound);
function aboutBtnstartSound(event:MouseEvent):void {
	
	if (aboutBtnchannel == null)
{
aboutBtnchannel = aboutBtnsnd.play(aboutBtnpausePosition);
}
}

Nav.aboutBtn.addEventListener(MouseEvent.MOUSE_OUT, aboutBtnstopSound);
function aboutBtnstopSound(event:MouseEvent):void {
aboutBtnchannel.stop();
aboutBtnchannel = null;
}

```
