8 Replies Latest reply on Dec 15, 2006 7:36 AM by HuskerJay

    Loop final .swf two times only

    HuskerJay
      I need to find a way to get my final .swf file to loop only two times. I know there's got to be a easy way to do this. Any assistance would be helpful. Thanks.
        • 1. Re: Loop final .swf two times only
          kglad Adobe Community Professional & MVP
          if you want to stop your timeline on its last frame the 2nd time it plays you can put the following on its last frame

          • 2. Re: Loop final .swf two times only
            HuskerJay Level 1
            I attached code to last frame in .fla file - same result.
            A little background.....the fla file's main timeline is only one frame with multiple layers that have various movie clips on the different layers. Also, I have on the actionscript layer a function reposition script (it's a liquid layout) below the stop(); script. I added the recommended script in place of the stop(); but the result was the same - one run through and then it stops. Thanks for your help.
            • 3. Re: Loop final .swf two times only
              kglad Adobe Community Professional & MVP
              what movieclip is supposed to loop twice and what timeline do you want to stop?
              • 4. Re: Loop final .swf two times only
                HuskerJay Level 1
                My goal is to get the final published .swf file to loop twice. Let me propose the following:
                a. since all the movie clips are sequencial, in other words each one follows the other....
                b. then extend each layer that the various movie clips are on to their particular length on the main Scene 1 timeline....
                c. and at the end attach the action script code you attached???
                make any kind of sense? again, I need to get the final product to run through twice.
                • 5. Re: Loop final .swf two times only
                  kglad Adobe Community Professional & MVP
                  i understand what you said, but it won't work. if you movieclips play sequentially, then one of them is the last to play in the sequence. what causes the first to play after the last finishes?
                  • 6. Re: Loop final .swf two times only
                    Generave Level 1
                    If you are thinking of expanding the timeline, how about this:

                    If I understand correctly, you have everything in multiple layers in the main timeline, but there is only one frame. You could move everything to frame 2 and just leave empty keyframes at frame 1 in each of your layers. You could then add the following code to one of those blank keyframes at frame 1:

                    gotoAndStop(2);

                    Then add code like kglad's to the last frame of the last movie that plays in your sequence, but modified to something like below. This will basically start your movie entirely over, looping once, playing twice in total. I only hope I've understood your project correctly:

                    • 7. Re: Loop final .swf two times only
                      HuskerJay Level 1
                      Generave,
                      Thank you SO MUCH! It works like a charm!...

                      I've got one last question - is there a way prior to the second run through, that it pauses for a few moments and then runs the second and final loop. Thanks.
                      • 8. Re: Loop final .swf two times only
                        HuskerJay Level 1
                        never mind my last request.....I just extended the last part of the last movie clip. works great. thanks again to everyone.