1 Reply Latest reply on Oct 2, 2006 1:25 AM by ggshow

    Preloader for Loader Component

    Hengy
      Hi, I am trying to make a Media Viewer in flash for my school website. When you click on a picture, I want a preloader to come up saying how much it has loaded of the picture. The picture is displayed in a Loader Component. I can make a preloader for the whole flash file, but I don't know how to convert it to work with a Loader Component.

      Here is the code.
      Frame 1:
      picLoader.contentPath = "Photos\IMG_2634.JPG";
      totalBytes = Math.round(picLoader.getBytesTotal() / 1024);
      loadedBytes = Math.round(picLoader.getBytesLoaded() / 1024);
      percentDone = Math.round((loadedBytes / totalBytes) * 100);
      loadBar._xscale = percentDone;
      if (percentDone != 100) {
      gotoAndPlay(1);
      }


      Frame 2:
      stop();

      Can anyone help me please?

      Thanks, Hengy