home *** CD-ROM | disk | FTP | other *** search
/ Champak 48 / cdrom_image.iso / Games / alex_trax.swf / scripts / __Packages / com / neodelight / mdm / MdmFile.as
Encoding:
Text File  |  2007-10-01  |  1.3 KB  |  44 lines

  1. class com.neodelight.mdm.MdmFile
  2. {
  3.    var bufferPath;
  4.    var bufferOut;
  5.    var f;
  6.    function MdmFile(action, path, data)
  7.    {
  8.       if(action === "append")
  9.       {
  10.          _root.stdout += "worker..\n";
  11.          this.bufferPath = path;
  12.          this.bufferOut = data;
  13.          this.delayedAppend.parent = this;
  14.          _global.mdm.fileexists(path,this.delayedAppend);
  15.       }
  16.    }
  17.    static function save(path, data)
  18.    {
  19.       data = com.neodelight.std.XString.replace(",","@c@",data);
  20.       _global.mdm.savetofile(path,data);
  21.    }
  22.    static function append(path, dat)
  23.    {
  24.       _root.stdout += "append()\n";
  25.       dat = com.neodelight.std.XString.replace(",","@c@",dat);
  26.       var _loc3_ = new com.neodelight.mdm.MdmFile("append",path,dat);
  27.    }
  28.    function delayedAppend(fileExists)
  29.    {
  30.       var _loc4_ = this.f.parent.bufferPath;
  31.       var _loc5_ = this.f.parent.bufferOut;
  32.       _root.stdout += " delayedAppend(): fileExists=" + fileExists + ", bufferPath=" + _loc4_ + ", bufferOut=" + _loc5_ + "\n";
  33.       _root.stdout += com.neodelight.std.XString.dump(this,{depth:2});
  34.       if(fileExists == "true")
  35.       {
  36.          _global.mdm.appendtofile(_loc4_,_loc5_);
  37.       }
  38.       else
  39.       {
  40.          _global.mdm.savetofile(_loc4_,_loc5_);
  41.       }
  42.    }
  43. }
  44.