5 Replies Latest reply on Mar 1, 2008 12:59 AM by kglad

    Advanced preloader question

      What I need is a preloader that can begin playing the first in a series of external swfs before all are loaded. I am building a preloader based on a MediaLoader class created by Macromedia years ago - the class is designed to load external swf files into an on-stage holder clip (the clip is passed into the MediaLoader object by reference), store these clips in an array, and then dispatch the array back to the main swf, which can then manipulate the clips.

      The pre-loader works fine as originally designed - that is, as long as no clips are played until all are loaded. I have tried many modifications to the preloader and associated code so the main movie will play the first clip gracefully before all are downloaded, with no success. Problems occur along these lines - the holder clip must be made visible and so show the downloading clips, if only for a fraction of a second before they are hidden; I tried using a second holder to start playing them in, and I tried loading off-stage. However, attempts to duplicate the loaded external swf affect - as they probably refer to - the original. (I read you cannot duplicate a loaded swf like other clips, but must reload it, which defeats the purpose of a preloader).

      I have asked about techniques and searched for examples, on many forums, of preloaders which can begin playing the first clip before all are downloaded, and have yet to see one.

      What are some techniques for doing this, if it is possible in AS 2? Are there examples?
        • 1. Re: Advanced preloader question
          kglad Adobe Community Professional & MVP
          what's the problem? the only necessity is, at least, two target movieclips.
          • 2. Advanced preloader question
            eLearningDeveloper Level 1
            The containing clip of all downloaded swf clips must be shown to play the first clip - so the others are shown, if only for a second. Maybe the whole problem is that there is a lag between the clip being loaded and the code stopping the loaded clips - is this a common problem with an easy solution? Otherwise, I am very interested to hear about how you use two target clips.

            Can you describe a technique, or link to an actual example of a preloader that allows a clip to play while others are still downloading?
            • 3. Re: Advanced preloader question
              kglad Adobe Community Professional & MVP
              you must use, at least, 2 mcs to use background loading. one target is used to display the current swf and the other is load in the background. assign the background target movieclip's _alpha to zero. or, even better, if you have control of the loading swfs, place an empty frame in frame 1 and attach a stop().
              • 4. Advanced preloader question
                eLearningDeveloper Level 1
                Do you mean that I need to download the first clip (or the clips I would like to have available to play) into one holder clip, begin playing that, and then download the remaining clips into a seperate invisible clip, which can then be made visible after they are all downloaded?
                • 5. Re: Advanced preloader question
                  kglad Adobe Community Professional & MVP
                  close but not exactly: you do download the first and after its download is complete, start its play and start the download of the next swf. when that finishes either play it (if the first is finished) or don't. in either case, you'll start the download of the next swf. when the currently playing swf finishes you'll start playing the next (if it's loaded).