# Rollover + sound

**URL:** <https://forum.kirupa.com/t/rollover-sound/261678>\
**Category:** Uncategorized\
**Created:** [May 29, 2008, 7:43pm UTC](https://forum.kirupa.com/t/rollover-sound/261678 "2008-05-29T19:43:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kuteykat](https://avatars.discourse-cdn.com/v4/letter/k/919ad9/32.png) [@kuteykat](https://forum.kirupa.com/u/kuteykat)\
**Post date:** [May 29, 2008, 7:43pm UTC](https://forum.kirupa.com/t/rollover-sound/261678/1 "2008-05-29T19:43:57Z")

</div>

Hi, I have a question about adding a sound to a rollover event.

I have a movie clip(middle) that has a rollover event on it to cue a button(blob) but I want a sound effect to play when the rollover happens. Is there a way to do this using actionscript? Any help would be appreciated, and sorry if this is a dumb question!

I’m using this code:

blob.\_visible=false;

middle.onRollOver=function(){  
blob.\_visible=true;

}

---

<div class="post-metadata">

**Author:** ![rbnzdave](https://avatars.discourse-cdn.com/v4/letter/r/a587f6/32.png) [@rbnzdave](https://forum.kirupa.com/u/rbnzdave)\
**Post date:** [May 29, 2008, 8:38pm UTC](https://forum.kirupa.com/t/rollover-sound/261678/2 "2008-05-29T20:38:59Z")

</div>

if using flash cs3 - add the sound file to your library, give it a linkage - Actionscript class name. I’ve loaded the ding.wav, and linked it as a class called dinger.

```auto
var sndOver:Sound = new dinger();

sndOver.play();

```
