A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Need to Loop Movie only 3 times

  1. #1
    Junior Member
    Join Date
    Apr 2003
    Posts
    2

    Need to Loop Movie only 3 times

    How do I get the movie to loop a specify amount of times.
    I want the movie to loop 3 times only.

    Thanks!

  2. #2
    Senior Member
    Join Date
    Mar 2003
    Location
    Ottawa, Canada
    Posts
    104
    Well, you could have a variable written to each time it loops,,,

    I have included a FLA that accomplishes this, I hope it helps....

    Note: In the fla, there is a symbol that is animated (animation within the MC). In frame one of the mc (its a ball), I set two variables. One for how many times it should loop, and the other just declaring for a counter. On frame 20, there is an conditional that either stops the movie if the counter var equals the howManyTimes it should loop variable (one of the two vars set in frame one of the ball symbol), or it increments the counter var and goes to frame two (because one of the vars declared in frame 1 gets incremented in frame 20, we cannot loop back to frame 1 (it would reset the counter to zero and we'd be in an infinite loop)).
    Attached Files Attached Files
    MX User.
    ------------------
    http://www.michaeldilts.com

  3. #3
    Junior Member
    Join Date
    Apr 2003
    Posts
    2
    Thank you for taking the time to post back.

    I will try it, it sounds kind of complicated for me, but I will give it a try. I was hoping it was just a matter of including a param tag to the html.

    Appreciate it!
    Last edited by lfields; 04-30-2003 at 12:44 PM.

  4. #4
    Junior Member
    Join Date
    Jun 2009
    Posts
    1

    Question

    what if i want to redirect to an specific URL after the 3 loops?

  5. #5
    Junior Member
    Join Date
    Sep 2009
    Posts
    2

    Looping

    Ifields ---

    Look at the file MyKal100 provided. It works and it's a great starting foundation for what you can do with looping. Take a look at his coded frames. The first frame of code is the variable. The last frame of code is the If Then statement based on the variable.

    If you look at the first part of the code in the last frame, you'll see
    if (countMe==howManyTimes) {
    stop();


    That is saying that if the movie has played 3 times, then "stop", in which the player will stop on that particular frame. Replace the stop(); code with a "getURL" function. Like this exactly but replace the full URL path with your own:
    getURL("http://www.yourdomain.com");

    Hope that helps. MyKal100 just helped me big time even though the post is 4 years old.

  6. #6
    Junior Member
    Join Date
    Sep 2009
    Posts
    2
    CCSCREATIVE,

    My post was for you instead of Ifields. Sorry.

  7. #7
    Junior Member
    Join Date
    Feb 2008
    Posts
    25
    thx mykal100!

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