gotoAndPlay not working correctly

Hi,

I’m trying to get a some flash movieclips to fade in and fade out again on mouse Rollover / out events. The rollover and fade up works fine, but the rollout just skips directly back to frame 1 without playing the bit I tell it to.

Heres the movieclip timeline and code:

I have stop() commands at the start and middle frames


mainBar.arenaClip.addEventListener(MouseEvent.ROLL_OVER, colorImage);
mainBar.arenaClip.addEventListener(MouseEvent.ROLL_OUT, fadeImage);
mainBar.shoeClip.addEventListener(MouseEvent.ROLL_OVER, colorImage);
mainBar.shoeClip.addEventListener(MouseEvent.ROLL_OUT, fadeImage);
mainBar.adClip.addEventListener(MouseEvent.ROLL_OVER, colorImage);
mainBar.adClip.addEventListener(MouseEvent.ROLL_OUT, fadeImage);

function colorImage(event:MouseEvent):void
{
	event.target.gotoAndPlay(event.target.colorIt);
}

function fadeImage(event:MouseEvent):void
{
	event.target.gotoAndPlay(event.target.fadeIt);
}


Like I say, colorIt bit works fine, but the fading down just skips back to the first frame without ever playing the fadeIt bit. Have confirmed with trace statements that the Event is triggering correctly.

Any help would be much appreciated!

Managed to get it working. For some reason it doesn’t work with the labels I have set, but if I use the frame number as below:

function colorImage(event:MouseEvent):void
{
	event.target.gotoAndPlay(2);
}

function fadeImage(event:MouseEvent):void
{
	event.target.gotoAndPlay(12);
}

It works fine… does that mean Frame Labels are purely cosmetic or do you need to set them up a certain way in their properties?

I don’t know if it’s for that, but here’s my guess

event.target.colorIt == ?
It is equals to mainBar.arenaClip.colorIt which is probably not set, i ithink what you were trying was
event.target.gotoAndPlay(“colorIt”);

I expect that event.target.colorIt was equals to null, which make
event.target.gotoAndPlay(null);
which makes… something… bad… and… unexpected…

Hopes that it helps

Lachhh