2 Replies Latest reply on Oct 31, 2007 7:30 AM by clbeech

    MovieClipLoader

    Darshan Rane Level 3
      hi i am trying to use MovieClipLoader for multiple loading on movieclip instance.

      I am loading thumbnails in mc instance and want to apply loading script to each mc instance.

      I am attaching the script i have used. the loading seems to be not happening even as images are loader.

      Currently i am using onl one image as test

      I am not able to figure out this.

      here's the code i have written

      stop();
      xpos = 80
      ypos = 0
      j = 0

      var thumbloader:MovieClipLoader = new MovieClipLoader();

      function onLoadInit(mc:MovieClip) {
      trace("Loading Initialized" + mc);
      }

      function onLoadComplete(mc:MovieClip) {
      trace("Loading Complete" + mc);
      //per.text = ""
      }

      function onLoadProgress(mc:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
      trace(bytesLoaded + " bytes loaded of " + bytesTotal);
      //per.text = int((bytesLoaded / bytesTotal) * 100)
      this.per.text = "Loading"
      }

      for(i=0;i<9;i++)
      {
      var thumb = thumbnails_mc.attachMovie("thumbnail","thumnail"+i,i)

      thumb.thumb_container.addListener(thumbloader)

      //thumb.thumb_container.loadMovie("img1_t.jpg");
      thumbloader.loadClip("img1_t.jpg",thumb.thumb_container);

      if(i != 0)
      {
      if((i % 3) == 0)
      {
      //trace("done" + i)
      ypos += 80
      j = 0
      }
      }

      thumb._x = j * xpos
      thumb._y = ypos
      j++
      }
        • 1. Re: MovieClipLoader
          kglad Adobe Community Professional & MVP
          :

          • 2. MovieClipLoader
            clbeech Level 3
            OK darr, you've got this a little 'discombobulated' :) the methods on the MCL class are handlers, not methods, and need to be called on a listener Object. Also you can use the onLoadInit (or onLoadComplete) handler to advance through the thumbnails, by calling another controling method, instead of using a FOR loop, which would cause calls to be made to the MCL all at one time, which won't really work for a multiple sequenced load. So for what your trying to do here you may want to write your code more like this:

            EDIT: sorry kg (again) was still writing this (dang it!! lol) (E2: ... I like the way you have that there)