4 Replies Latest reply on May 24, 2008 1:20 PM by Flash_Forms_Question

    looking for a way to preload multiple swfs

    Flash_Forms_Question Level 1
      I originally created a single file with 18 scenes, but have since switched to a structure that load the swf's chronologically and when a user picks one to watch from the menu.

      Im looking for a newbie-proof example to reverse engineer'(or a good tutorial)

      What I need is a way to preload the swf's ahead without it displaying or advancing its frames until it is called.

      any suggestions
        • 1. Re: looking for a way to preload multiple swfs
          clbeech Level 3
          you could do so using the MovieClipLoader class, constructing a series of MCs, and calling stop on their timelines, as well as placing them as a stack, and invisible. You will need two arrays, and controls for the playback. the first array would hold the path names to the swf files - the second would hold the instances on stage for linkage to the control structure. you would toggle the visibility of the current MC to the selected - stop the previous and start the selection. It would look a bit like this:

          • 2. Re: looking for a way to preload multiple swfs
            Flash_Forms_Question Level 1
            I'll try that and see if it works. I think I even understand it! Thanks! any suggestions on how to make a visible preloader that would work with it?
            • 3. Re: looking for a way to preload multiple swfs
              clbeech Level 3
              sure - see that's the beauty of the MovieClipLoader method - it has handlers for these types of things built into the class - in the case of your preloader you would use the onLoadProgress handler to effect the preload animation (whatever that is) by using a percentage of the bytes loaded - the handler is triggered when new data is written to the harddisk during loading so there is no need to perform a loop. in with the codes belows, add the following previous to the onLoadInit handler, and adjust it to your needs - call the preloader to _visible=false in the onLoadInit handler to get rid of it when the load is complete.
              • 4. Re: looking for a way to preload multiple swfs
                Flash_Forms_Question Level 1
                I don't really understand how to implement the second bit of code (where does it go?), or how it affects the preload animation and starts the movie once a percentage is loaded. I am a beginner when i comes to actionscript. My project is in actionscript 2... is the code you suggest actionscript 2 or 3?

                I need the preloader code too. or a link to a tutorial for one that would work. I'm more a designer than programmer.