home *** CD-ROM | disk | FTP | other *** search
/ Computer Active 2010 August / CA08.iso / Multimedija / shufflr.air / ShufflrClient.swf / scripts / com / althea / client / shufflr / model / MiscCommandProxy.as < prev    next >
Encoding:
Text File  |  2010-06-23  |  2.0 KB  |  72 lines

  1. package com.althea.client.shufflr.model
  2. {
  3.    import com.althea.client.shufflr.ApplicationFacade;
  4.    import mx.rpc.AsyncToken;
  5.    import mx.rpc.IResponder;
  6.    import mx.rpc.http.HTTPService;
  7.    import org.puremvc.as3.multicore.patterns.proxy.Proxy;
  8.    
  9.    public class MiscCommandProxy extends Proxy implements IResponder
  10.    {
  11.       public static const NAME:String = "MiscCommandProxy";
  12.       
  13.       private var service:HTTPService;
  14.       
  15.       private var username:String;
  16.       
  17.       public function MiscCommandProxy(param1:Object = null)
  18.       {
  19.          super(NAME,param1);
  20.          this.service = new HTTPService();
  21.          this.service.method = "GET";
  22.          this.service.requestTimeout = 20;
  23.       }
  24.       
  25.       public function fault(param1:Object) : void
  26.       {
  27.          var dataType:String = null;
  28.          var rpcEvent:Object = param1;
  29.          try
  30.          {
  31.             dataType = rpcEvent.token.dataType;
  32.             switch(dataType)
  33.             {
  34.                case "isInviteEnabled":
  35.             }
  36.          }
  37.          catch(errObj:Error)
  38.          {
  39.             trace(errObj.message);
  40.          }
  41.       }
  42.       
  43.       public function result(param1:Object) : void
  44.       {
  45.          var dataType:String = null;
  46.          var rpcEvent:Object = param1;
  47.          try
  48.          {
  49.             dataType = rpcEvent.token.dataType;
  50.             switch(dataType)
  51.             {
  52.                case "isInviteEnabled":
  53.                   this.sendNotification(ApplicationFacade.SHOW_REGISTRATION,rpcEvent.result.rss.channel.invite_code_enabled);
  54.             }
  55.          }
  56.          catch(errObj:Error)
  57.          {
  58.             trace(errObj.message);
  59.          }
  60.       }
  61.       
  62.       public function isInviteEnabled() : void
  63.       {
  64.          this.service.url = NavMapProxy.serverUrl + "invite_code_enabled";
  65.          var _loc1_:AsyncToken = this.service.send(null);
  66.          _loc1_.dataType = "isInviteEnabled";
  67.          _loc1_.addResponder(this);
  68.       }
  69.    }
  70. }
  71.  
  72.