A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: numbered loops + reset

  1. #1
    Junior Member
    Join Date
    May 2003
    Location
    Oop North
    Posts
    4

    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.

  2. #2
    Senior Member jbum's Avatar
    Join Date
    Feb 2004
    Location
    Los Angeles
    Posts
    2,920
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center