Problem with rollOver/rollOut

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

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.

[QUOTE=gacca;2324612]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[/QUOTE]

[quote=small_guy;2324651]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.[/quote]

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 [COLOR=#810081]www.gigaturn.com[/COLOR], 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.