Log in

View Full Version : Actionscript3 Roll over to disappear afer mouse event!



jumpropek
11-26-2008, 08:24 AM
hello AS3 experts, I can't get the caption to appear on right images
and I'm really hoping that someone will come through here...

I basically have an image(movie clip that has 4 images with repsective labels) in the center of main timeline.

I want to show caption on each of these 4 images on mouse over, and
on mouse out caption fadeout. I have numbers 1,2,3,4 on bottom of the image so that when I click on #2 it will go and play image2 inside the movieClip.
I've set the if condition below... (example code just shows 2 images)

when I click image#2 and mouse over the image I see the caption in and out fine, problem is when I click on image#1 instead of showing caption for this image it jumps back to image#2 with its caption...

PLEASE HELP!!!!

Here's my code:
//hit is the invisible movie clip I placed on main timeline,
snrSlide is the MC that has 4 images with different labels for captions


hit.addEventListener(MouseEvent.MOUSE_OVER, cap1);
hit2.addEventListener(MouseEvent.MOUSE_OVER, cap2);


function cap1(e:MouseEvent){
if(snrSlide.currentFrame == 7);
snrSlide.gotoAndPlay("overSnr");
}
function cap2(e:MouseEvent){
if(snrSlide.currentFrame == 27);
snrSlide.gotoAndPlay("over2");
}

hit.addEventListener(MouseEvent.MOUSE_OUT, capOut1);
hit2.addEventListener(MouseEvent.MOUSE_OUT, capOut2);

function capOut1(e:MouseEvent):void{
if(snrSlide.currentLabel == "overSnr")
{
snrSlide.gotoAndPlay("outSnr");
} else
{
snrSlide.gotoAndPlay(7);
}
}
function capOut2(e:MouseEvent):void{
if(snrSlide.currentLabel == "over2")
{
snrSlide.gotoAndPlay("out2");
} else
{
snrSlide.gotoAndStop(27);
}
}

jumpropek
11-26-2008, 08:30 AM
in other words image#2 won't go away, even on image#1 when I mouse over it shows image#2 with its caption. I don't know how to use removeEvent or other methods to resolve this...