Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Repeated sound effect when mouse over 1

Status
Not open for further replies.

Jennyucf

Instructor
Jun 22, 2001
215
US
Hi, there

I have a few buttons with the click sound effect. The problem is that when the mouse is rolled over, the "click" sound repeated twice. Would you please take a look at the fla file that was uploaded in the briefcase?? Thank you so much.

User: ids4681
Password: group3
File: Sound button

Again, thanks a lot!

Cheers
 
The problem is that, with the sound physically on the over state of the button, it loops as soon as it's finished so if your mouse is on the buton long enough it'll repeat the sound.

Two ways around this:

1) put the sound in a short movie clip with a stop() action at the end.

2) create a sound object:

this on the main timeline...

buttonSound=new Sound();
buttonSound.attachSound('myButtonSound');

you need to set the 'linkage' property of your sound in the library to 'myButtonSound' for it to be found

this on the button...

on(rollOver){
_root.buttonSound.start();
//I've put in the _root path to be safe here but it might not be necessary
}
 
Hi, Warbar

Thank you for the code!!! I tried it and it still seemed mad at me..:-( I think it's not just the "loop" problem, as I also put some animation on the button. Do you think that would cause the problem too?

I appreciate your help very much!

Cheers
Jenny
 
Hi Jenny. I put together a quick example of how the code works and put it in your briefcase (hope that's ok, I'd usually post the fla on my site but I'm away from my own PC and can't remember the ftp details offhand).

The example plays a sound on rollOver and release of the button and it should be easy to transfer over to your own movie.
 
Hi, Wangbar
oh, yeah! Thank you very much! It seems interesting to learn...although the sound effect of buttons that I want to achieve is little bit different from this one..but it's very good to learn this technique..

Many thanks!!
Jenny
 
Yeah, I just grabbed the first sounds I could find but all you have to do is add your new sound to the library and change the 'linkage' property and it'll work with any sound.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top