A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: How to loop 3 times then stop??

  1. #1
    Junior Member
    Join Date
    Mar 2000
    Posts
    22
    I posted this question already, but I still can't resolve the problem. I need to loop an animation 3 times, then stop at the very end. I know in flash 5, the "loop while" command no longer exist. I was also told to use the counter method where I'll set a variable name =1 then have it loop until it is => 3. I understand the logic behind it, but
    can somebody write down the scripts precisely and where I should place it exactly?? Is it at the very opening frame or do I need 2 separate actionscipts?? And do I also need to have my loop in a movie clip instead??

    Thanks...Rob

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Posts
    134

    :)))

    Why don't you try to set the variable at the begining of the animation (first frame) and to evulate it with IF action at the end i.e if(variable<=3)goToAndPlay...flame2...couse to avoud reset it again!
    This is the most simple loop!

    Good luck!

  3. #3
    this loops three times

    for(i=1;i<4;i++)
    {
    to do code here
    }

    but i think you need it spreading over several frames


    frame1:
    var i=1;

    frame2:
    i++;

    frame3:
    if(i<4) gotoandplay(2);


    "i" increases on frame 2 and on frame 3 if it is still less than 4 go back to frame 2.


  4. #4
    Junior Member
    Join Date
    Mar 2000
    Posts
    22
    Still can't get it quite to work. What about my actual loop? Should it be a in movie clip??

    Rob


    Originally posted by davidnorth100
    this loops three times

    for(i=1;i<4;i++)
    {
    to do code here
    }

    but i think you need it spreading over several frames


    frame1:
    var i=1;

    frame2:
    i++;

    frame3:
    if(i<4) gotoandplay(2);


    "i" increases on frame 2 and on frame 3 if it is still less than 4 go back to frame 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