# Button with sound on rollover

**URL:** <https://forum.kirupa.com/t/button-with-sound-on-rollover/188689>\
**Category:** Uncategorized\
**Created:** [May 10, 2006, 2:26am UTC](https://forum.kirupa.com/t/button-with-sound-on-rollover/188689 "2006-05-10T02:26:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Icehawk](https://avatars.discourse-cdn.com/v4/letter/i/51bf81/32.png) [@Icehawk](https://forum.kirupa.com/u/Icehawk)\
**Post date:** [May 10, 2006, 2:26am UTC](https://forum.kirupa.com/t/button-with-sound-on-rollover/188689/1 "2006-05-10T02:26:04Z")

</div>

hi i have a button that plays a sound when you roll over it but is there a way i can get this sound to loop until you rollout?

also when i rollover it repeats x2 but if i rollover while its playing it starts another sound so its doing 2 at once is there a way to avoid this ?

this is my codes

Home.onRollOver = function() {  
clickMe();  
}

function clickMe() {  
// Simple basic structure of a sound called from library  
sfx = new Sound();  
// Calls the “click02.mp3” that linked as “click” from the library through the linkage option  
sfx.attachSound(“click”);  
// Like car’s engine, you need to ask it to ‘start’ for it to work.  
sfx.start(0,2);  
}
