PDA

View Full Version : Looping a SWF limited times



sixfish
July 31st, 2002, 01:25 PM
I need to loop my SWF 3 times and have it freeze on the last frame of the movie. I assume a conditional "if" "else" action is needed but cannot get it too work. Any help???

Thanks,
sixfish

jsk
July 31st, 2002, 05:06 PM
Try this:

firstFrame of your FLA

counter=1

lastFrame of you FLA

if (counter==3) {
stop();
} else {
counter++;
gotoAndPlay(2);
}

sixfish
July 31st, 2002, 06:08 PM
i added this code to the last frame only:

counter = counter+1;
if (counter<3) {
_root.mcalbums.gotoAndPlay(1);
} else {
_root.mcalbums.gotoAndStop("final");
}

"mcalbums" was my movie clip. I couldn't believe how simple it was. I was looking at books, trying "do while" and "for" statements, complicating things.

Usually the simplist solution is the right answer!

Thanks again.