A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Loop help

  1. #1
    Junior Member
    Join Date
    Sep 2000
    Posts
    13
    I am something of a Flash newjack, so bear with me.... Is there any way to make an animation or movie clip loop a specified number of times and stop... sounds simple, but i can't for the life of me figure it out... i don't mean using actionscripts... because (thanks to this site) i even know how to put a text box in an animation, enter a number from 1-9 and have the animation to loop that many times... but i want to know how i would go about programming a set number of loops in an animation... HELP!!!!!

    THANKS

  2. #2
    Senior Member
    Join Date
    Sep 2000
    Posts
    1,159

    resolved A Couple of Ways...

    There are several ways that you can do this. Here is one:

    Start your animation on Frame 2
    In Frame 1, define a variable and give it a value of 1
    In the last frame of your animation, put the following code in the action tab:

    If (Variable Name = # )
    Go to and Stop (1)
    Else
    Set Variable: "Variable Name" = Variable Name +1
    Go to and Play (2)
    End If

    All this method does is set a variable to a value and then increment the value by 1 each time the animation plays. When the variable equals the specified #, the animation stops. Not elegant, but it does work.

    Variable Name is the name you give your variable.
    # is the number of times you want it to animate.

    Hope this helps!

  3. #3
    Junior Member
    Join Date
    Sep 2000
    Posts
    13
    thanks googly, but everything worked except for the last line.... when i typed END IF, it says that there was an error in the scripting... i have flash5... could this be the reason why? it doesn't seem to recognize END IF as a command....

  4. #4
    Junior Member
    Join Date
    Sep 2000
    Posts
    13
    you could also end your movie in the timeline by inserting a blank keyframe

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