home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Aventura / Frizzle_fraz.swf / scripts / Code / LIB / MP / _ir253.as next >
Encoding:
Text File  |  2008-09-26  |  6.3 KB  |  203 lines

  1. package Code.LIB.MP
  2. {
  3.    import Code.LIB._bm350;
  4.    import flash.events.Event;
  5.    import flash.events.HTTPStatusEvent;
  6.    import flash.events.IOErrorEvent;
  7.    import flash.events.ProgressEvent;
  8.    import flash.events.SecurityErrorEvent;
  9.    import flash.net.URLLoader;
  10.    import flash.net.URLLoaderDataFormat;
  11.    import flash.net.URLRequest;
  12.    
  13.    public class _ir253
  14.    {
  15.        
  16.       
  17.       public var dbname:String;
  18.       
  19.       public var name:String;
  20.       
  21.       public var state:int;
  22.       
  23.       public var loader:URLLoader;
  24.       
  25.       public var ProcessingError:Boolean;
  26.       
  27.       public var MultiScriptLocation:String;
  28.       
  29.       public const PUT_RECORD:int = 106;
  30.       
  31.       public var dbpass:String;
  32.       
  33.       public var data:Array;
  34.       
  35.       public var dblogin:String;
  36.       
  37.       public var ConnectionError:Boolean;
  38.       
  39.       public var dblocation:String;
  40.       
  41.       public var fields:int;
  42.       
  43.       public var request:URLRequest;
  44.       
  45.       public var rows:int;
  46.       
  47.       public const GET_GAME:int = 105;
  48.       
  49.       public const NORMAL:int = 100;
  50.       
  51.       public var PutScriptLocation:String;
  52.       
  53.       public var seed:int;
  54.       
  55.       public var status:String;
  56.       
  57.       private var iMp:_tu345;
  58.       
  59.       public var complete_t:Boolean;
  60.       
  61.       public var GetScriptLocation:String;
  62.       
  63.       public var game_log:String;
  64.       
  65.       public const GET_RECORD:int = 104;
  66.       
  67.       public function _ir253(param1:_tu345)
  68.       {
  69.          request = new URLRequest();
  70.          loader = new URLLoader();
  71.          super();
  72.          this.iMp = param1;
  73.          state = this.NORMAL;
  74.          fields = 0;
  75.          rows = 0;
  76.          data = new Array();
  77.          complete_t = true;
  78.          ConnectionError = false;
  79.          ProcessingError = false;
  80.          loader.dataFormat = URLLoaderDataFormat.TEXT;
  81.          loader.addEventListener(ProgressEvent.PROGRESS,progress);
  82.          loader.addEventListener(IOErrorEvent.IO_ERROR,_se131);
  83.          loader.addEventListener(HTTPStatusEvent.HTTP_STATUS,_yl425);
  84.          loader.addEventListener(Event.COMPLETE,complete);
  85.          loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR,onSecurityError);
  86.       }
  87.       
  88.       public function _cp397(param1:String) : void
  89.       {
  90.       }
  91.       
  92.       public function _yl425(param1:HTTPStatusEvent) : void
  93.       {
  94.       }
  95.       
  96.       public function onSecurityError(param1:SecurityErrorEvent) : void
  97.       {
  98.          trace(param1.text);
  99.       }
  100.       
  101.       public function _nw391(param1:String, param2:int, param3:int, param4:String, param5:int, param6:String) : void
  102.       {
  103.          complete_t = false;
  104.          request.url = PutScriptLocation + "?" + "dbname=" + dbname + "&" + "dblogin=" + dblogin + "&" + "dbpass=" + dbpass + "&" + "query=" + "insert into " + param1 + " values (\'" + param2 + "\',\'" + param3 + "\',\'" + param4 + "\',\'" + param5 + "\',\'" + param6 + "\',\'" + _bm350._dt66 + "\')" + "&" + "dbtable=" + param1 + " &native=" + int(_bm350.iNative);
  105.          loader.load(request);
  106.       }
  107.       
  108.       public function _py136(param1:String, param2:String, param3:String) : void
  109.       {
  110.          dbname = param1;
  111.          dblogin = param2;
  112.          dbpass = param3;
  113.       }
  114.       
  115.       public function progress(param1:ProgressEvent) : void
  116.       {
  117.       }
  118.       
  119.       public function _he250(param1:String) : void
  120.       {
  121.          param1 = param1.toLocaleLowerCase();
  122.          complete_t = false;
  123.          request.url = GetScriptLocation + "?" + "dbname=" + dbname + "&" + "dblogin=" + dblogin + "&" + "dbpass=" + dbpass + "&" + "query=" + "SELECT score,name FROM " + param1 + " limit 10";
  124.          loader.load(request);
  125.       }
  126.       
  127.       public function _se131(param1:IOErrorEvent) : void
  128.       {
  129.          trace(param1.text);
  130.          ConnectionError = true;
  131.          state = this.NORMAL;
  132.          complete_t = true;
  133.       }
  134.       
  135.       public function _eq380(param1:String, param2:int, param3:int) : void
  136.       {
  137.          param1 = param1.toLocaleLowerCase();
  138.          complete_t = false;
  139.          request.url = MultiScriptLocation + "?" + "dbname=" + dbname + "&" + "dblogin=" + dblogin + "&" + "dbpass=" + dbpass + "&" + "query=" + "SELECT id,name,game_seed,game_log FROM " + param1 + " WHERE id=" + param2 + " AND game_seed=" + param3 + " order by rand() limit 1 &rand=" + int(Math.random() * 9999).toString() + "&native=" + int(_bm350.iNative);
  140.          loader.load(request);
  141.       }
  142.       
  143.       public function complete(param1:Event) : void
  144.       {
  145.          var _loc2_:String = null;
  146.          var _loc3_:Array = null;
  147.          var _loc4_:int = 0;
  148.          var _loc5_:int = 0;
  149.          var _loc6_:int = 0;
  150.          this.complete_t = true;
  151.          ConnectionError = false;
  152.          _loc2_ = new String(loader.data);
  153.          status = _loc2_.substring(0,3).valueOf();
  154.          trace(status);
  155.          _loc2_ = _loc2_.substring(3,_loc2_.length);
  156.          if(status == this.GET_RECORD.toString())
  157.          {
  158.             _loc3_ = new Array();
  159.             if(_loc2_.indexOf(">") >= 0)
  160.             {
  161.                return;
  162.             }
  163.             _loc3_ = _loc2_.split("&");
  164.             rows = _loc3_[1].valueOf();
  165.             fields = _loc3_[2].valueOf();
  166.             _loc4_ = 0;
  167.             while(_loc4_ < rows)
  168.             {
  169.                data[_loc4_] = [_loc3_[3 + _loc4_ * 2],_loc3_[4 + _loc4_ * 2]];
  170.                _loc4_++;
  171.             }
  172.             _loc4_ = 0;
  173.             while(_loc4_ < rows)
  174.             {
  175.                trace(data[_loc4_]);
  176.                _loc4_++;
  177.             }
  178.             state = this.NORMAL;
  179.          }
  180.          if(status == this.GET_GAME.toString())
  181.          {
  182.             _loc3_ = new Array();
  183.             if(_loc2_.indexOf(">") >= 0 || _loc2_.indexOf("<") >= 0)
  184.             {
  185.                return;
  186.             }
  187.             _loc3_ = _loc2_.split("&");
  188.             name = _loc3_[4];
  189.             seed = _loc3_[5];
  190.             game_log = _loc3_[6];
  191.             this.iMp._id169 = game_log;
  192.             this.iMp._jt493 = name;
  193.             trace(name + " " + seed + "  " + game_log);
  194.             state = this.NORMAL;
  195.          }
  196.          if(status == this.PUT_RECORD.toString())
  197.          {
  198.          }
  199.          state = this.NORMAL;
  200.       }
  201.    }
  202. }
  203.