home *** CD-ROM | disk | FTP | other *** search
/ The Complete Idiot's Guide to Microsoft Excel 2010 / CIGExcel.iso / Videos / Flash / controller.swf / scripts / __Packages / com / techsmith / utils / Util.as < prev    next >
Encoding:
Text File  |  2010-09-09  |  1.2 KB  |  47 lines

  1. class com.techsmith.utils.Util
  2. {
  3.    function Util()
  4.    {
  5.    }
  6.    static function prnObj(obj, sp)
  7.    {
  8.       var _loc3_ = "";
  9.       if(sp == undefined)
  10.       {
  11.          sp = "";
  12.       }
  13.       for(var _loc4_ in obj)
  14.       {
  15.          if(typeof obj[_loc4_] == "object")
  16.          {
  17.             _loc3_ += sp + _loc4_ + " = " + "{\n" + com.techsmith.utils.Util.prnObj(obj[_loc4_],sp + "  ") + sp + "}\n";
  18.          }
  19.          else
  20.          {
  21.             _loc3_ += sp + _loc4_ + " = " + obj[_loc4_] + "\n";
  22.          }
  23.       }
  24.       return _loc3_;
  25.    }
  26.    static function doObjectsMatch(a, b)
  27.    {
  28.       return com.techsmith.utils.Util.prnObj(a) == com.techsmith.utils.Util.prnObj(b);
  29.    }
  30.    static function sprintf(str)
  31.    {
  32.       var _loc4_ = 1;
  33.       var _loc5_ = 0;
  34.       var _loc2_ = undefined;
  35.       _loc2_ = str.indexOf("@",_loc2_);
  36.       while(_loc2_ != -1 && _loc4_ < arguments.length)
  37.       {
  38.          str = str.slice(_loc5_,_loc2_) + arguments[_loc4_] + str.substring(_loc2_ + 1);
  39.          _loc2_ += "" + arguments[_loc4_].length;
  40.          _loc2_ = str.indexOf("@",_loc2_);
  41.          _loc4_;
  42.          _loc4_++;
  43.       }
  44.       return str;
  45.    }
  46. }
  47.