16 Replies Latest reply on Jan 25, 2010 9:15 PM by Harry Kunz

    kglad's preloader

    Star_Tail_Pro
      In away I specifcily asking him but anyone can join in. On countless times I have tried and failed to make a preloader that will start on 0%. Then stupidly i realised ite the preloader itslef thats making it start 10%. I only mange to get it down to start at that percent as i exported the classes to fram 2 instead of 1. But still the preloader doesn't start on 0-% so i figure the only thing i haven't tried is to have a stand-alone.

      On the first frame of my main .swf i have:
      _root.stop();
      loadMovieNum("nebula/mainpreloader.swf", 2);

      But in my mainpreloader.swf I have:
      var num = setInterval(this, "preload", 10);
      _root.prebar_mc.stop();
      function preload() {
      var tBy = _root.getBytesTotal();
      var lBy = _root.getBytesLoaded();
      trace("tBy: "+tBy);
      trace("lBy: "+lBy);
      var div = lBy/tBy;
      trace("div: "+div);
      var per = Math.round(div*100);
      _root.prebar_mc.gotoAndStop(per);
      trace("per: "+per);
      _root.per_txt.text = per+"%";
      lBy = _root.getBytesLoaded();
      if(tBy == lBy) {
      _root.per_txt.text = "100%";
      clearInterval(num);
      _root.prebar_mc.stop();
      }
      }

      I know the _root will be the mainpreloader.swf main timeline but how does it get the main .swf getBytesLoaded(); get BytesTotal();?