7 Replies Latest reply on Oct 23, 2006 7:24 AM by wendigo

    Loading multiple movies in sequence

    wendigo
      I'm trying to make multiple movies show through a main file in sequence (slide0.swf, slide1.swf, slide2.swf etc etc).

      I've been using some fla document that was sent to me to do such a thing but somehow I can't get things to work exactly as intended.

      My main file/movie uses these pieces of actionscript to do the loading of the sequential files/movies

      (see attached code)




      __________________________________________

      Now if I do not add anything to my other clips, the main file just keeps looping the first one over and over rather than going up through them all sequentialy. So I tried adding this in the last frame of each of the movies/clips to be displayed

      (Last Frame)

      _root.addIDX();

      ___________________________________

      The problem I now have is that although now the movies are playing one after the other sequentialy I still get a small amount of repeat (fraction of a second) of the movie that just played before the newly loaded one displays.

      Is there a way that I can make this transition work smoothly rather than have a jerky moment of flashback before each new movie in the sequence starts playing?

      Thanks
        • 1. Re: Loading multiple movies in sequence
          TimSymons Level 1
          What about adding a stop() action too.

          stop();
          _root.addIDX();

          That way the current movie won't automatically loop to the beginning and start playing again.

          Tim
          • 2. Re: Loading multiple movies in sequence
            wendigo Level 1
            Thanks for the suggestion, unfortunately it did not fix the jerky overlap I am getting as it behaves the same with or without the stop(); when being displayed in the main file.
            • 3. Re: Loading multiple movies in sequence
              TimSymons Level 1
              Couple of things I would check.

              1) In Frame 8 you say you have the following code:

              setInterval
              stop();

              Is the setInterval supposed to be there?

              2) In you "doInterval" function you are using the clearInterval function but I am not certain that you are using the correct path the to "myInterval" variable. You may want to change it to read:

              var doInterval:Function = function(){
              _root.top.play();
              clearInterval(_root.myInterval);
              }


              Tim
              • 4. Re: Loading multiple movies in sequence
                wendigo Level 1
                Thanks for the help Tim, it's greatly appreciated. I've applied your change to the doInterval function as well as test what the removing the setInterval on frame 8 would do. Even after these I get the same display issue/problem.

                I'm including a link to a test page showing the sequence here so you may see visualy what it is I'm trying to fix. The seeing it may help make more sense of it than the way I have explained it.

                http://192.197.118.103/spwslides.html

                Once again, thanks for taking the time to try and help me out.
                • 5. Re: Loading multiple movies in sequence
                  TimSymons Level 1
                  It looks like you are loading 2 clips so that when one is finished the next one will play without delay and then it loads the next in the series beneath it.

                  The flash that I am seeing is from the one that is hidden. Before it begins to play, the next movie is loaded and you see it, then they play in the correct order.

                  Try placing the code you have in the onLoadComplete event into the onLoadInit event. Like this:

                  listen.onLoadInit = function(mc:MovieClip) {
                  mc.play();
                  _root.myInterval=setInterval(doInterval,delay);
                  loadbtm.loadClip(list[(IDX+1)%numImages],_root.btm);
                  };

                  And comment out the following:

                  //listen.onLoadComplete = function(mc:MovieClip) {
                  // loadbtm.loadClip(list[(IDX+1)%numImages],_root.btm);
                  //};


                  The onLoadComplete event gets called first and starts loading your next slide before the onLoadInit event gets called. This small delay maybe enough to be causing the flash you are seeing.

                  Tim
                  • 6. Re: Loading multiple movies in sequence
                    wendigo Level 1
                    I've switched the function to the onLoadInit instead of where it was in the onLoadComplete as suggested. But no chance there as I am still getting the same pattern with the delay in the sequence of clips being played.
                    • 7. Re: Loading multiple movies in sequence
                      wendigo Level 1
                      I went through the code once more and inverted the couple of calls to function being done in the onLoadInit area and it now works the proper way.

                      Thanks for all the help Tim.