4 Replies Latest reply on Feb 20, 2008 11:41 AM by perree

    Movie occasionally stalls in middle--WHY?

    perree
      Hello,

      I created a Flash movie that is an online test. There are many audio files that get downloaded before the movie starts to play. Most of the time, the movie works just fine and users can take the test through to the finish. However, sometimes the test stalls after one of the test sections (which is a Scene in the Flash movie) and the user cannot continue. Often, if they reboot and restart the test, it works fine. I was hoping one of you experts could perhaps help me with:

      -what could be causing this behavior? If the downloaded files are too big, then how can I clear some of the RAM after the audio files have been played?

      -I thought once a movie was compiled it would play. I am just baffled as to what could be causing these occasional stalls.

      I just don't know where to start looking as it doesn't always stall and when it does stall/stop, it is not always after the same scene.

      -Is there a technique to ensure the movie will never stall?

      Any help/thoughts would be much appreciated!

      Thanks!
        • 1. Re: Movie occasionally stalls in middle--WHY?
          kglad Adobe Community Professional & MVP
          this could be caused by a swf that starts to play before it's completely loaded or whose play is interrupted by a loading external file that's needed for the swf to continue.
          • 2. Re: Movie occasionally stalls in middle--WHY?
            perree Level 1
            Hello and thank you for your help. I still don't understand why the inconsistent behavior--is that related to bandwidth or the version of the Flash player? Anyway, if you don't mind, could you please have a [what I hope will be a] quick look at the preloader code, to see if anything looks like it might be causing a problem? Also, I think the problem might be related to later in the test when the movie loads other swfs in the background while the movie is playing. Would it be possible for the movie to finish the scene before the swfs have been fully downloaded for the next scene? When the movie moves to the next scene, would it stop the background loading. If this is causing problems, then would it be better to load ALL swfs needed for the movie in the pre-loader? I thought I would save on loading time, if I only loaded the first couple sections at the beginning and loaded the other sections later. Anyway, preloader code:




            • 3. Re: Movie occasionally stalls in middle--WHY?
              kglad Adobe Community Professional & MVP
              if that's preloader code only, you're doing something wrong.

              and:

              Also, I think the problem might be related to later in the test when the movie loads other swfs in the background while the movie is playing. Would it be possible for the movie to finish the scene before the swfs have been fully downloaded for the next scene?

              yes, external file loading is 'asynchronous', meaning you can start the load and before it finishes (or even starts to load), you can continue to execute subsequent code and timelines will continue to play. if you move to another scene you are going to remove everything not created with actionscript.
              • 4. Re: Movie occasionally stalls in middle--WHY?
                perree Level 1
                Hello and thanks again for your comments.

                OK maybe I was wrong when I set up the whole thing. You see each section has audio and images and they must be synchronized. So, I put each mp3 (audio for each test question) in a blank mc and exported each one as a swf. I did the same for each of the images needed to go with the audio (each image in a little swf). I figured then I would have the audio and images available to put in the test where they need to be and to be played when they need to be played.

                The code above essentially loads necessary swfs for the first section and then starts to play.

                I have been away from Flash for a while, but when I designed the test and did the research, I thought (for some reason) it would be better to set things up this way rather than embed all of the audio files and images in the movie library itself (correct me if I'm wrong, please). From a design standpoint and for reliability, would it in fact be better to have all of the gifs and audio in the movie's library and export the whole thing. Then, I would just load the one big movie, instead of all the external swfs and then I wouldn't have these problems, right?

                Alternatively, I assume I could pull all the code that is executed later and that loads other external swfs for subsequent scenes and put all of that with the "preloader" I already have.

                As I said, I would say the test works fine about 90-95% of the time, and I don't really want to rewrite everything from scratch but would like to have more reliability that it will not hang. Any suggestions on what to do for this?

                Thanks for your input--