home *** CD-ROM | disk | FTP | other *** search
/ Computer Active 2010 August / CA08.iso / Multimedija / shufflr.air / ShufflrClient.swf / scripts / com / facebook / net / FacebookCall.as next >
Encoding:
Text File  |  2010-06-23  |  2.5 KB  |  87 lines

  1. package com.facebook.net
  2. {
  3.    import com.facebook.data.FacebookData;
  4.    import com.facebook.delegates.IFacebookCallDelegate;
  5.    import com.facebook.errors.FacebookError;
  6.    import com.facebook.events.FacebookEvent;
  7.    import com.facebook.facebook_internal;
  8.    import com.facebook.session.IFacebookSession;
  9.    import flash.events.EventDispatcher;
  10.    import flash.net.URLVariables;
  11.    
  12.    use namespace facebook_internal;
  13.    
  14.    public class FacebookCall extends EventDispatcher
  15.    {
  16.       public var method:String;
  17.       
  18.       public var success:Boolean = false;
  19.       
  20.       public var args:URLVariables;
  21.       
  22.       public var delegate:IFacebookCallDelegate;
  23.       
  24.       public var error:FacebookError;
  25.       
  26.       public var useSession:Boolean = true;
  27.       
  28.       public var session:IFacebookSession;
  29.       
  30.       public var result:FacebookData;
  31.       
  32.       public function FacebookCall(param1:String = "no_method_required", param2:URLVariables = null)
  33.       {
  34.          super();
  35.          this.method = param1;
  36.          this.args = param2 != null ? param2 : new URLVariables();
  37.       }
  38.       
  39.       facebook_internal function handleError(param1:FacebookError) : void
  40.       {
  41.          this.error = param1;
  42.          this.success = false;
  43.          dispatchEvent(new FacebookEvent(FacebookEvent.COMPLETE,false,false,false,null,param1));
  44.       }
  45.       
  46.       facebook_internal function handleResult(param1:FacebookData) : void
  47.       {
  48.          this.result = param1;
  49.          this.success = true;
  50.          dispatchEvent(new FacebookEvent(FacebookEvent.COMPLETE,false,false,true,param1));
  51.       }
  52.       
  53.       facebook_internal function setRequestArgument(param1:String, param2:Object) : void
  54.       {
  55.          if(param2 is Number && isNaN(param2 as Number))
  56.          {
  57.             return;
  58.          }
  59.          if(param1 && param2 != null && String(param2).length > 0)
  60.          {
  61.             this.args[param1] = param2;
  62.          }
  63.       }
  64.       
  65.       facebook_internal function clearRequestArguments() : void
  66.       {
  67.          this.args = new URLVariables();
  68.       }
  69.       
  70.       facebook_internal function initialize() : void
  71.       {
  72.       }
  73.       
  74.       protected function applySchema(param1:Array, ... rest) : void
  75.       {
  76.          var _loc3_:uint = param1.length;
  77.          var _loc4_:uint = 0;
  78.          while(_loc4_ < _loc3_)
  79.          {
  80.             this.facebook_internal::setRequestArgument(param1[_loc4_],rest[_loc4_]);
  81.             _loc4_++;
  82.          }
  83.       }
  84.    }
  85. }
  86.  
  87.