1 Reply Latest reply on Feb 29, 2008 5:13 AM by Newsgroup_User

    Shrinking loadbar

      I want to create a preloader with a loadbar that shrinks from left to right. My loadbar is a white box. I want it to uncover the layer behind it effectively revealing more of an image as the swf loads. My code (below) works if I try to "grow" the loadbar. I was trying to use a minus sign to reverse the math, but I couldn't figure out where to put it. In case it matters, I have my movie set up with the anchor point on the right side (since that's the point I want to stay fixed).

      Thanks in advance.

      Action script to make loadbar grow (How do I make it shrink, instead?):

      bytes_loaded = Math.round(this.getBytesLoaded());
      bytes_total = Math.round(this.getBytesTotal());
      getPercent = bytes_loaded/bytes_total;
      this.loadBar._width = getPercent*(100);
      this.loadText = Math.round(getPercent*100)+"%";
      if (bytes_loaded == bytes_total) {
      this.gotoAndPlay (5);