-
numbered loops + reset
I have an animation with a menu screen. When you click the 'go to the pub' button, it loops a few frames (of him downing a pint) 3 times, then progresses to the end (him falling off the stool). Then it goes back to the menu.
That all works fine the 1st time, but any times after that the middle just loops endlessly.
This is the code I used for the loop, put into a frame at the end of the section I wanted looping:
Code:
loopNum++;
if (loopNum == 3) {
nextFrame();
} else {
gotoAndPlay(276);
}
I need some code to reset the loopNum value to 0. I can't figure it out!
If you need the file to look at, just ask! I t may have to be the .swf though, the .fla file is 8Mb.
-
Senior Member
code:
loopNum++;
if (loopNum == 3) {
loopNum = 0; // reset here...
nextFrame();
} else {
gotoAndPlay(276);
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|