1 Reply Latest reply on Jun 20, 2006 7:03 AM by DrFrankenscript

    getBytesLoaded not a number

    DrFrankenscript
      I have a multi load onEnterFrame that first loads 6 external SWFs, tracks their
      progress, executes the corresponding external SWF function then loads the
      first page (external SWF home page), runs it's load sequence then waits for
      user interaction. All loads are tracked within the same onEnterFrame.

      This system works fine only after it bombs the first time and you refresh the
      page (Something to do with the browser cache?). If I run a trace on the
      getBytesLoaded method...

      *** BEGIN SNIPPET ***

      var loadLoaded:Number = _global.loadObj[0][_global.intCnt].getBytesLoaded();
      //Make sure stream has started
      if (isNaN(loadLoaded) || loadTotal < 4){
      //return;
      davecntTest = "-"+loadLoaded+"|"+_global.loadType+"-";
      }

      *** END SNIPPET ***

      It starts as a byte reference number and stops at about 1645 bytes, then turns into
      a string where isNaN is true. But ONLY when I test the movie in streaming mode
      or when it is loaded the FIRST time in a brower.

      ******* BEGIN LARGER VIEW *******

      lcc_engine.onEnterFrame = function() {

      ...more code...

      //begin define the load
      if(_global.loadType==1 && runLMonce==0){
      //load one of many objects
      _global.loadObj[0][_global.intCnt].loadMovie(_global.loadObj[1][_global.intCnt]);
      //we have made the load; don't run until called
      runLMonce = 1;
      //set the message now
      _global.loadMessage = _global.loadObj[2][_global.intCnt];
      }else if(runLMonce==0){
      //load the one and only object
      _global.loadObj[0].loadMovie(_global.loadObj[1]);
      //we have made the load; don't run until called
      runLMonce = 1;
      //set the message now
      _global.loadMessage = _global.loadObj[2];
      }

      ...more code ....

      //begin track the load
      //gather load info
      if(_global.loadType==1){
      //multiple load
      var loadLoaded:Number = _global.loadObj[0][_global.intCnt].getBytesLoaded();
      var loadTotal:Number = _global.loadObj[0][_global.intCnt].getBytesTotal();

      }else if(_global.loadType==0){
      //single load
      var loadLoaded:Number = _global.loadObj[0].getBytesLoaded();
      var loadTotal:Number = _global.loadObj[0].getBytesTotal();

      }
      ...continues to launch after...

      //jump out of OEF and launch if fully loaded
      if (loadLoaded / loadTotal >= 1 && loadTotal > 500){

      ******* END LARGER VIEW *******

      I hope this is enough information...

      I have tried a multitude of tests that all seem to point to the loading SWF losing
      it's getBytesLoaded information somehow.

      Any thoughts that could point me in the right direction would be great. I just saw
      another grey hair pop up...