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

  1. package com.althea.client.shufflr.controller
  2. {
  3.    import com.althea.client.shufflr.ApplicationFacade;
  4.    import com.althea.client.shufflr.model.SourceSiteProxy;
  5.    import com.althea.client.shufflr.model.UserProxy;
  6.    import com.althea.client.shufflr.model.vo.RegistrationDescriptor;
  7.    import com.facebook.data.users.FacebookUser;
  8.    import org.puremvc.as3.multicore.interfaces.ICommand;
  9.    import org.puremvc.as3.multicore.interfaces.INotification;
  10.    import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
  11.    
  12.    public class RegisterCommand extends SimpleCommand implements ICommand
  13.    {
  14.       public function RegisterCommand()
  15.       {
  16.          super();
  17.       }
  18.       
  19.       private function get sourceSiteProxy() : SourceSiteProxy
  20.       {
  21.          return this.facade.retrieveProxy(SourceSiteProxy.NAME) as SourceSiteProxy;
  22.       }
  23.       
  24.       override public function execute(param1:INotification) : void
  25.       {
  26.          var _loc3_:String = null;
  27.          var _loc4_:RegistrationDescriptor = null;
  28.          var _loc5_:String = null;
  29.          var _loc6_:FacebookUser = null;
  30.          var _loc2_:String = param1.getName();
  31.          switch(_loc2_)
  32.          {
  33.             case ApplicationFacade.REGISTER:
  34.                _loc4_ = param1.getBody() as RegistrationDescriptor;
  35.                this.proxy.register(_loc4_);
  36.                break;
  37.             case ApplicationFacade.CHECK_USERNAME:
  38.                _loc5_ = String(param1.getBody());
  39.                this.proxy.checkUsername(_loc5_);
  40.                break;
  41.             case ApplicationFacade.FACEBOOK_DATA:
  42.                _loc6_ = FacebookUser(param1.getBody());
  43.                this.proxy.sendFacebookData(_loc6_);
  44.                break;
  45.             case ApplicationFacade.CHECK_KEY:
  46.                _loc3_ = String(param1.getBody());
  47.                this.proxy.checkKey(_loc3_);
  48.                break;
  49.             case ApplicationFacade.ACTIVATE_KEY:
  50.                _loc3_ = String(param1.getBody());
  51.                this.proxy.activateKey(_loc3_);
  52.                break;
  53.             case ApplicationFacade.READ_SOURCE_SITE:
  54.                this.sourceSiteProxy.getSourceSiteTitle();
  55.          }
  56.          if(param1.getType() == "checkUsername")
  57.          {
  58.          }
  59.       }
  60.       
  61.       private function get proxy() : UserProxy
  62.       {
  63.          return this.facade.retrieveProxy(UserProxy.NAME) as UserProxy;
  64.       }
  65.    }
  66. }
  67.  
  68.