View Full Version : Problem with rollOver/rollOut
gacca
May 11th, 2008, 08:07 AM
Hi,
I'm hoping that some of you have had the same problem. I have made a MovieClip that acts as button. When user rolls out from it, a sound plays, but the problem is that when I roll over the button, the flash for some unknown reason sometimes starts making multiple rollOvers/rollOuts in quick succession. Anyone know what might be the problem?
Gatis
small_guy
May 11th, 2008, 11:18 AM
On your rollOver even handler add a stopAllSounds();
I assume that your sound is set up as a lingage sound and not something you've put on a timeline.
Your whole code might then look something like this:
var my_sound:Sound = new Sound();
my_sound.attachSound("music"); //or whatever the name is you've given it in linkage
//since you want no sounds to be playing on the RollOver action:
movieClip_btn.onRollOver = function() {
stopAllSounds();
}
//since you want the sound to play on the rollOut action:
movieClip_btn.onRollOut = function() {
my_sound.start();
}
I hope this addresses your question successfully.
Hi,
I'm hoping that some of you have had the same problem. I have made a MovieClip that acts as button. When user rolls out from it, a sound plays, but the problem is that when I roll over the button, the flash for some unknown reason sometimes starts making multiple rollOvers/rollOuts in quick succession. Anyone know what might be the problem?
Gatis
jitu78
May 12th, 2008, 04:14 AM
On your rollOver even handler add a stopAllSounds();
I assume that your sound is set up as a lingage sound and not something you've put on a timeline.
Your whole code might then look something like this:
var my_sound:Sound = new Sound();
my_sound.attachSound("music"); //or whatever the name is you've given it in linkage
//since you want no sounds to be playing on the RollOver action:
movieClip_btn.onRollOver = function() {
stopAllSounds();
}
//since you want the sound to play on the rollOut action:
movieClip_btn.onRollOut = function() {
my_sound.start();
}
I hope this addresses your question successfully.
Hi Small_guy,
Not seems small at all.
Any way, I've one issue with my flash code for music palyer. It's IE browser issue.
Please visit www.gigaturn.com (http://www.gigaturn.com/), its my new work.
Go to flash work from top links and check music player.
There you will see some error/warning in IE, how can I fix it?
Thanks in advance.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.