Packagecom.thirdavedesign.drupalSite.connection
Classpublic class Amf
SubclassesDrupalSite

Amf is an ActionScript 3 class for handling AMF connections to Drupal services.

Amf provides a basic method (service) for invoking a Drupal service via an Amf connection. This method establishes a NetConnection if one is not already configured. It handles the response from the NetConnection, which it passes to a callback function, if specified.

Amf also provides a connect method, which ensures that the Amf class has the current session ID.



Public Properties
 PropertyDefined by
  apiKey : String = ""
API key for Drupal services.
Amf
  gatewayUrl : String = ""
URL to the Drupal services AMFPHP gateway.
Amf
  sessionId : String = ""
Session ID from successful connection to Drupal services.
Amf
Public Methods
 MethodDefined by
  
connect(onSuccess:Function):void
Invoke Drupal system.connect service method to establish connection with Drupal services.
Amf
  
service(onSuccess:Function, onFault:Function, command:String, ... args):Boolean
Invoke Drupal services method.
Amf
Property detail
apiKeyproperty
public var apiKey:String = ""

API key for Drupal services.

gatewayUrlproperty 
public var gatewayUrl:String = ""

URL to the Drupal services AMFPHP gateway.

sessionIdproperty 
public var sessionId:String = ""

Session ID from successful connection to Drupal services.

Method detail
connect()method
public function connect(onSuccess:Function):void

Invoke Drupal system.connect service method to establish connection with Drupal services.

Parameters
onSuccess:Function — Callback function on successful connection.
service()method 
public function service(onSuccess:Function, onFault:Function, command:String, ... args):Boolean

Invoke Drupal services method.

Parameters
onSuccess:Function — Callback function on successful call.
 
onFault:Function — Callback function on failed call.
 
command:String — Drupal services method to invoke.
 
... args — args [Optional] Arguments to pass to Drupal services method. If only one argument is supplied and it is an array, then it is taken as the array of arguments with which to invoke the Drupal service.

For example, the following calls of the service method result in the same arguments being passed to Drupal:

Amf.service(onSuccess, onFault, 'node.load', apikey, sessid, nid);

Amf.service(onSuccess, onFault, 'node.load', new Array(apikey, sessid, nid));

Returns
Boolean