Question

I have some AS3 I am trying to write in order to create a mouse over/mouse out of an information image.

I have two frames, one of them has a button shaped as a circle with an "i" in it for information and frame two has the same button, slightly different colour with a big speech bubble next to it.

I need to set it so that by default it shows frame 1, when you mouse over it goes to frame two and stops and then when you mouse off the "i" button it goes back to frame 1.

movieClip_1.addEventListener (MouseEvent.MOUSE_OVER, mouseOverInfoButton);

function mouseOverInfoButton (e:MouseEvent):void
{
gotoAndStop(2);
}

movieClip_1.addEventListener (MouseEvent.MOUSE_OUT, mouseOutInfoButton);

function mouseOutInfoButton (e:MouseEvent):void
{
gotoAndStop(1);
}
Was it helpful?

Solution

You have called gotoAndStop of your this object in both mouseOverInfoButton and mouseOutInfoButton. To change the frame of movieClip_1 you need to call gotoAndStop on that movie clip.

movieClip_1.gotoAndStop(1); // or 2 in other case

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top