Skip to main content
Participating Frequently
November 10, 2006
Question

button mouseOver sound problem

  • November 10, 2006
  • 1 reply
  • 298 views
I have searched the forums and interweb to see if I can find somebody complaining of this problem before, but I can't seem to find anything.

What I have is a handful of buttons on the stage that play a sound on rollover. At first, I simply had this sound placed in the over state of the button, but once the problem started occuring, I figured I would actionscript the sound, but still have no luck solving the problem.

Basically, if a user goes over the buttons at a normal pace, the sound plays perfectly. However, if the user starts speeding over the buttons, to enjoy the interesting sound, it goes NUTS and starts to layer, seemingly playing multiple sounds at once.

I even thought I found a solution myself, by forcing the sound to stop prior to playing, but this didn't solve the issue either. The actionscript I am using is below:

//actionscript in frame
//load mouse over sound
moSound = new Sound();
moSound.attachSound("boop")

//actionscript on each button
on(rollOver, dragOver){
trace("Sound on")
_root.moSound.start()
}
on(rollOut, dragOut){
trace("Sound off")
_root.moSound.stop()
}

Even the trace text appears correctly! (e.g. "sound on", "sound off", "sound on", "sound off", "sound on", "sound off", etc.) It NEVER appears with "ons" paired together. So i'm stumped here. I even thought maybe the sound was corrupt, but have used about 5 different sounds now, to mo avail!

Please help 🙂
This topic has been closed for replies.

1 reply

November 10, 2006
hi,
i have checked the code.
but, its seems there is no mistakes.
you may be use more than one buttons.
but, i am checking this for a single button.
if you are using more buttons, try to use a single sound Object.
and add one more line before you going to start a new sound,
this will avoid your problem.

the code:

//actionscript on each button
on(rollOver, dragOver){
trace("Sound on")
_root.moSound.stopAllSounds()
_root.moSound.start()
}

Participating Frequently
November 10, 2006
Still the same result. Slow mouse overs sound right. Quick mouse overs sound stacked.