A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Yet another looping question

  1. #1
    Junior Member
    Join Date
    Apr 2000
    Posts
    22
    I just need to know how to loop a movieclip a set number of times. Like say 20.

    Even better would be a loop that enables me to play the frames in the mc forward then backwards...
    that would be extra special.


    Any help would be appreciated.

  2. #2
    Hack
    Join Date
    Mar 2000
    Location
    Madison, WI
    Posts
    1,753
    In frame 1 of the movieclip:

    loopnum++;

    In the last frame:

    if (loopnum>19) {
    stop();
    }


    To play forward and backward 20 times,

    In the first frame:

    backward=0
    if (loopnum>19) {
    stop();
    } else {
    loopnum++;
    }

    In the second to last frame:

    backward=1;

    Then get outside the movieclip and give it this action


    onClipEvent (enterFrame) {
    if (backward) {
    gotoAndPlay (_currentframe-2)
    }
    }

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