home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 136 / MOBICLIC136.ISO / pc / DATA / HOTE / libs / amfphp / amfphp.swf / scripts / __Packages / AmfPhp.as
Text File  |  2011-07-20  |  2KB  |  45 lines

  1. class AmfPhp extends MovieClip
  2. {
  3.    function AmfPhp()
  4.    {
  5.       super();
  6.       trace("AmfPhp " + this);
  7.       _global._amfphp_ = this;
  8.    }
  9.    static function main(p)
  10.    {
  11.       p.mc.__proto__ = AmfPhp.prototype;
  12.       p.mc.p = p;
  13.       AmfPhp.apply(p.mc);
  14.    }
  15.    function Init()
  16.    {
  17.       this._DefaultUrl = "http://localhost/flashservices/gateway.php";
  18.    }
  19.    function Call(p)
  20.    {
  21.       trace("Call : " + this.Call);
  22.       var _loc2_ = {};
  23.       _loc2_.p = p;
  24.       var _loc3_ = p.url != undefined ? p.url : this._DefaultUrl;
  25.       trace("gatewayUrl : " + _loc3_);
  26.       mx.remoting.debug.NetDebug.initialize();
  27.       var _loc4_ = new mx.remoting.Service(_loc3_,null,p.service,null,null);
  28.       var _loc5_ = _loc4_[p.fonction](p.params);
  29.       _loc2_.handleResult = function(re)
  30.       {
  31.          trace("The result is: " + re.__get__result() + " " + this.p + " " + this.p.mc + " " + this.p.retour);
  32.          this.p.mc[this.p.retour]({resultat:re.__get__result()});
  33.       };
  34.       _loc2_.handleError = function(fe)
  35.       {
  36.          trace("There was a problem: " + fe.__get__fault().__get__faultstring());
  37.          trace("The faultcode is: " + fe.__get__fault().__get__faultcode());
  38.          trace("The detail: " + fe.__get__fault().__get__detail());
  39.          trace("The error class name is: " + fe.__get__fault().__get__type());
  40.          this.p.mc[this.p.retour]({erreur:fe.__get__fault()});
  41.       };
  42.       _loc5_.__set__responder(new mx.rpc.RelayResponder(_loc2_,"handleResult","handleError"));
  43.    }
  44. }
  45.