15 Replies Latest reply on Sep 12, 2008 1:10 PM by kglad

    Stop External SWF from looping

    mymandi
      I have spent two days troubleshooting this issue and have founds TONS of threads that talk about this topic but none that answer my exact situation. I apologize if this is answered somewhere else but here is my situation:

      I have a main .fla that I have one of three external swfs play at random in, via a blank video component (with an instance of movieTarget ). Each individual swf has an action of stop(); on the last frame of each, and when played separate from this main .fla stop just fine.

      However when incorporated into this main .fla, when a swf is chosen it plays on loop. I need to figure out how to stop it. I have added a loader code to my main .fla code to detect when the chosen swf has completely loaded, but do not know where to go from here. I have attatched my action script code for review.

      The larger picture here, is that this will be embedded in an html splash page, which when one of these swfs play, it will fade into the website. The idea being that every time a user comes to the site, a different intro will play and then go to the site. So if there is another, more simpler way to achieve this, let me know.

      I appreciate anyone taking the time to read this and help out. I can really use the help. Thanks in advance.


        • 1. Re: Stop External SWF from looping
          kglad Adobe Community Professional & MVP
          if the loaded swf is main timeline based, add a stop() to the main timeline's last frame.
          • 2. Re: Stop External SWF from looping
            mymandi Level 1
            thanks for responding!

            I actually tried that and what happened is my main .fla upon export just showed a white blank screen and my output would have a line of the swf that was chosen to play and about every second a new line would show with a new swf that was chosen to play. This list continues to grow until I close the main movie.
            (for example my output would look something like this:
            http://www.krv.com/flashintros/snow.swf
            http://www.krv.com/flashintros/snow.swf
            http://www.krv.com/flashintros/surf.swf
            http://www.krv.com/flashintros/snow.swf) )

            I believe this has something to do with the fact that the second frame gets read before the first frame is fully loaded and played. Which is why I installed the loader to detect when the swf was fully downloaded. But I just dont know how to use it for my case..... any ideas?
            • 3. Re: Stop External SWF from looping
              kglad Adobe Community Professional & MVP
              i don't know what you're trying to convey with those links, but i didn't see a problem.

              and putting a stop() on your loaded swfs last frame has no impact on your preloader so if that was working before, it will continue to work.
              • 4. Re: Stop External SWF from looping
                mymandi Level 1
                I dont think my previous post made too much sense, let me try explaining it again.
                I have a main flash file that has one of three external swfs loaded randomly into frame 1 via a blank video component. The entire main .fla only takes up one frame. For some reason the exported main .fla file loops and I dont want it to.

                Here are the things I have attempted to do to resolve this issue that have not worked so far:
                • put a stop(); at the end of each individual swf (this works when the swf is played on its own outside of the main .fla, but when pulled into the main swf it loops)
                • use the command _root.stop(); at the end of each individual swf (still didnt work)
                • put a stop(); on the last frame of the main .fla (this makes the entire main swf show a white screen)

                Does this make more sense? Any help is appreciated. Thanks


                • 5. Re: Stop External SWF from looping
                  kglad Adobe Community Professional & MVP
                  what do you mean by loading a swf "..via a blank video component"?
                  • 6. Re: Stop External SWF from looping
                    mymandi Level 1
                    In my main .fla file in frame 1 I have a video component. (I added this by going to my library panel options>new video...) this serves as the container that the swfs get pulled into. The instance name is movieTarget and I reference this instance name in my code.Does this answer your question?

                    • 7. Re: Stop External SWF from looping
                      kglad Adobe Community Professional & MVP
                      what do your swfs have to with flash video? and what code do you use to "pull" your swfs into a video instance?
                      • 8. Re: Stop External SWF from looping
                        mymandi Level 1
                        It should probably be noted that I am a newbie at flash and still have alot to learn.

                        With that said I have attached the code that I use to randomly pull in the swfs. (Not sure if thats even the right terminology to use.....)

                        I dont quite understand your first question, can you rephrase it? Thanks!

                        • 9. Re: Stop External SWF from looping
                          kglad Adobe Community Professional & MVP
                          delete the video instance from your library. it has nothing to do with your code.

                          also remove that loadMovie() function. it's unneeded and is causing duplicate loading which is problematic.

                          if your video instance is movieTarget, create an empty movieclip with that instance name before your loadClip() method executes.

                          those corrections will probably solve your problem.
                          • 10. Stop External SWF from looping
                            mymandi Level 1
                            Ok, so I did those things and everything still works fine. BUT it still loops.

                            Since changing the code per your instructions, I attempted these solutions again and nothing still worked:
                            • put a stop(); at the end of each individual swf
                            • use the command _root.stop(); at the end of each individual swf
                            • put a stop(); on the last frame of the main .fla

                            One interesting thing. When I tried putting a stop at the last frame of the main .fla, this time instead of my output showing a growing list of attempted swf plays, it just showed one. The exported swf still only played a white screen, but perhaps this is progress?

                            I have attached my new code to make sure I followed your instructions properly.
                            • 11. Re: Stop External SWF from looping
                              kglad Adobe Community Professional & MVP
                              your main swf has more than 1 frame? why? what else is going on in main?
                              • 12. Re: Stop External SWF from looping
                                mymandi Level 1
                                It doesn't. It only has one. The only times it has ever had more than one is when I inserted a new keyframe in frame 2 to put stop(); in the action script log. But I removed that because it wasn't working....
                                • 13. Re: Stop External SWF from looping
                                  kglad Adobe Community Professional & MVP
                                  is that loadClip() code on the main timeline?
                                  • 14. Re: Stop External SWF from looping
                                    mymandi Level 1
                                    I AM AN IDIOT.

                                    I fixed the problem. In all my efforts and countless hours troubleshooting to get this thing to stop looping, I never once uploaded my new swfs to the server. I always just imported them into the main fla thinking thats where they were pulling. In fact, because they are external loading swfs, they were pulling from the server. REALLY basic stuff here.

                                    Thanks for your time to help. It wasn't all lost because I learned that the movie was double loading from one of your responses.

                                    thanks again....
                                    • 15. Re: Stop External SWF from looping
                                      kglad Adobe Community Professional & MVP
                                      you're welcome.