PDA

View Full Version : Returning to a previous frame?


inqy
10-25-2008, 05:13 PM
Soo, I have a pretty simple flash interaction going on. One of my buttons is connected to a function that has a gotoAndStop function for 6 different frames.

What I've been trying to do is loop back to the start frame, when the end frame is reached. I tried gotoAndStop(start frame #), I tried prevFrame(), I tried labeling the start frame and doing a gotoAndStop("frame_label"). I guess I'm missing something, because it won't return to the start frame.

Can anyone help me? My current problem code is below.



color_btn.addEventListener(MouseEvent.CLICK, color8);

function color8 (e:MouseEvent):void{
gotoAndStop("colors");
}



-- new info:
It seems the above script actually works. But when my movie returns to the "colors" frame, it doesn't play the ActionScript on that frame. The AS plays the first time around.

orange gold
10-30-2008, 12:34 AM
color_btn.addEventListener(MouseEvent.CLICK, color8);

function color8 (e:MouseEvent):void{
gotoAndPlay("colors");
}


you had gotoAndStop not gotoAndPlay

also to get the previous frame if thats what your trying to do use this method...

get.previousFrame();

in as3 it might be get.prevFrame(); i think.. it might also be that in as2 i dont remember.. lol goodluck xD

BasTaI2d
10-30-2008, 05:06 AM
If gotoAndPlay doesn't work, try play("colors");

inqy
11-03-2008, 04:39 PM
Thank you for the help. I had actually tried gotoAndPlay as well, which didn't work, and play("colors") didn't work.

I fixed the problem by rearranging my frames, but I have yet to find a way to force my AS to play more than once on any frame beyond frame 1.