home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 128 / MOBICLIC128.ISO / pc / DATA / HOTE / libs / amfphp / amfphp.swf / scripts / __Packages / AmfPhp.as
Text File  |  2010-09-30  |  2KB  |  44 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 _loc5_ = p.url != undefined ? p.url : this._DefaultUrl;
  25.       mx.remoting.debug.NetDebug.initialize();
  26.       var _loc3_ = new mx.remoting.Service(_loc5_,null,p.service,null,null);
  27.       var _loc4_ = _loc3_[p.fonction](p.params);
  28.       _loc2_.handleResult = function(re)
  29.       {
  30.          trace("The result is: " + re.__get__result() + " " + this.p + " " + this.p.mc + " " + this.p.retour);
  31.          this.p.mc[this.p.retour]({resultat:re.__get__result()});
  32.       };
  33.       _loc2_.handleError = function(fe)
  34.       {
  35.          trace("There was a problem: " + fe.__get__fault().__get__faultstring());
  36.          trace("The faultcode is: " + fe.__get__fault().__get__faultcode());
  37.          trace("The detail: " + fe.__get__fault().__get__detail());
  38.          trace("The error class name is: " + fe.__get__fault().__get__type());
  39.          this.p.mc[this.p.retour]({erreur:fe.__get__fault()});
  40.       };
  41.       _loc4_.__set__responder(new mx.rpc.RelayResponder(_loc2_,"handleResult","handleError"));
  42.    }
  43. }
  44.