1 Reply Latest reply on Feb 2, 2007 12:23 PM by Newsgroup_User

    Preloader Problem

    Max5005
      Hi,
      I have a flash document. One swf file. I have a preloader that works fine using total bytes of the the file and total loaded bytes.
      I have a situation where I want show loading progress up to a certain frame, not the whole document.
      I know I can use total frames loaded compared with my target frame, however 90% of the data is in one frame.
      So if I use frames to calculate the progress, the % loaded will stay at 10% for a while and then will jump to 100%.
      I can't use total bytes because I don't want to wait for the whole document to load.

      So is there a way, to find out the what the byte total is at a certain frame.

      Thanks
      Max
        • 1. Re: Preloader Problem
          Level 7
          Max,
          Give this a try, it will go to the frame you designate when the preloader
          reaches 90%


          //
          bytes_loaded = Math.round(_root.getBytesLoaded())+1;
          bytes_total = Math.round(_root.getBytesTotal());
          getPercent = bytes_loaded/bytes_total;
          trace("getPercent " +getPercent )
          backwards = getPercent*242;
          _root.loadBar._width = 242-backwards;
          _root.loadText = Math.round(getPercent*100);
          //if the getPercent equals 90 percent then gotoAndPlay 2
          if (getPercent>=.90) {
          _root.gotoAndPlay(4);
          }

          //

          --

          Dan Mode
          --> Adobe Community Expert
          *Flash Helps* http://www.smithmediafusion.com/blog/?cat=11
          *THE online Radio* http://www.tornadostream.com
          *Must Read* http://www.smithmediafusion.com/blog




          "Max5005" <webforumsuser@macromedia.com> wrote in message
          news:eq01vv$53r$1@forums.macromedia.com...
          > Hi,
          > I have a flash document. One swf file. I have a preloader that works fine
          > using total bytes of the the file and total loaded bytes.
          > I have a situation where I want show loading progress up to a certain
          > frame,
          > not the whole document.
          > I know I can use total frames loaded compared with my target frame,
          > however
          > 90% of the data is in one frame.
          > So if I use frames to calculate the progress, the % loaded will stay at
          > 10%
          > for a while and then will jump to 100%.
          > I can't use total bytes because I don't want to wait for the whole
          > document to
          > load.
          >
          > So is there a way, to find out the what the byte total is at a certain
          > frame.
          >
          > Thanks
          > Max
          >