home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2005 May / PCpro_2005_05.ISO / files / mut / 9430830 / client.swf / scripts / frame_28 / DoAction_3.as < prev    next >
Encoding:
Text File  |  2004-12-15  |  1.9 KB  |  76 lines

  1. function loadSettings()
  2. {
  3.    settings = new XML();
  4.    settings.ignoreWhite = true;
  5.    settings.onLoad = function(success)
  6.    {
  7.       this.clearLoadCheck();
  8.       if(success)
  9.       {
  10.          renderSettings();
  11.       }
  12.    };
  13.    settings.preload(fsp_path + "9430830/9430830/settings.xml",false);
  14. }
  15. function loadContent(content_info)
  16. {
  17.    trace("loadContent");
  18.    cd_content = new XML();
  19.    cd_content.ignoreWhite = true;
  20.    cd_content.onLoad = function(success)
  21.    {
  22.       this.clearLoadCheck();
  23.       if(success)
  24.       {
  25.          initApp();
  26.       }
  27.    };
  28.    cd_content.preload(fsp_path + content_info,false);
  29. }
  30. var mainTimeline = this;
  31. XML.prototype.checkLoadProgress = function()
  32. {
  33.    var _loc2_ = Math.floor(this.getBytesLoaded() / 1024);
  34.    var _loc3_ = Math.floor(this.getBytesTotal() / 1024);
  35.    var _loc4_ = !isNaN(Math.floor(_loc2_ / _loc3_ * 100)) ? Math.floor(_loc2_ / _loc3_ * 100) : 0;
  36.    this.onBytesLoaded(this.getBytesLoaded(),this.getBytesTotal(),_loc2_,_loc3_,_loc4_);
  37. };
  38. XML.prototype.clearLoadCheck = function()
  39. {
  40.    if(this.loaderID)
  41.    {
  42.       clearInterval(this.loaderID);
  43.    }
  44. };
  45. XML.prototype.preload = function(url, noCache)
  46. {
  47.    trace("preload");
  48.    this.clearLoadCheck();
  49.    if(typeof noCache == "boolean" && noCache)
  50.    {
  51.       this.load(url + "?randomNum=" + random(999));
  52.    }
  53.    else
  54.    {
  55.       this.load(url);
  56.    }
  57.    this.loaderID = setInterval(this,"checkLoadProgress",200);
  58. };
  59. XML.prototype.sendAndPreload = function(url, resultXML, noCache)
  60. {
  61.    this.clearLoadCheck();
  62.    if(resultXML instanceof XML)
  63.    {
  64.       if(typeof noCache == "boolean" && noCache)
  65.       {
  66.          this.sendAndLoad(url + "?randomNum=" + random(999),resultXML);
  67.       }
  68.       else
  69.       {
  70.          this.sendAndLoad(url,resultXML);
  71.       }
  72.       this.loaderID = setInterval(this,"checkLoadProgress",200);
  73.    }
  74.    return false;
  75. };
  76.