3 Replies Latest reply on Apr 5, 2007 12:58 PM by Newsgroup_User

    MovieClipLoader class

    DZ-015 Level 1
      I've used the Movie Clip Loader class before to load one item, or a list of items... (load one, set up a listener object... use the onLoadInit event to tell Movie Clip Loader to load the next... etc...)

      but I find myself at a place where I need to load about 5-10 (depending on the page) images at once. Is there a way to do this with the MovieClipLoader class with just one MovieClipLoader and just one listener object? or will I have to set up a ton of each?

        • 1. Re: MovieClipLoader class
          Level 7
          DZ-015,

          > I find myself at a place where I need to load about
          > 5-10 [images] at once. Is there a way to do this
          > with the MovieClipLoader class with just one
          > MovieClipLoader and just one listener object?

          You can invoke that load() method as often as you like. Set up one
          listener. Every one of the events carries with it an object with a target
          property to let you know which event belongs to which container.


          David Stiller
          Adobe Community Expert
          Dev blog, http://www.quip.net/blog/
          "Luck is the residue of good design."


          • 2. Re: MovieClipLoader class
            kglad Adobe Community Professional & MVP
            just use a for-loop to start them all loading using the same mcl. what you do with a listener, if anything, depends upon what you need to do after loading is complete and the objects are initialized.
            • 3. Re: MovieClipLoader class
              Rothrock Level 5
              Have you tried it? That would be the absolute quickest way to find out.

              I believe you can just do this:

              for(var i=0;i<10;i++){
              myMCL.loadClip("fileURL"+i+".jpg",myHome["holder"+i"]);
              }

              You won't be able to control which order they load in, and your onLoadInit event handler will just need to keep track and know what to do when they are all loaded. The onLoadProgress will not total all the bytesTotal for you, you will need to do that yourself if you want one integrated loadprogress bar.