If anyone has checked any of my PureMVC Flex examples that connect to a Remote Service (usually ColdFusion) they will notice I use a delegate class as the gateway to ColdFusion from all of my Proxies. I have recently noticed that most of my examples on line (typically named RemoteDelegate.as) usually pass an Object as a parameter for the remote request and I have not uploaded a version to accept multiple arguments in the call from the proxy to the delegate and in turn the request to ColdFusion.
Below is a link to a more flexible RemoteDelegate.as Class which now handles multiple arguments to invoke a remote request. Obviously the delegate uses RemoteObject and so can be changed to a different destination so your not limited to just ColdFusion.
An example of how to invoke the RemoteDelegate within a proxy and make a remoting call is below.
-
private var remoteDelegate:RemoteDelegate;
-
-
remoteDelegate = new RemoteDelegate( this, CF_API );
-
-
remoteDelegate.call( "cfMethod", param1, param2, param3 );
* NOTE *
Thanks to docsultant for the dynamic method invocation heads up.


One Comment
thanks for this. I use a RemoteDelegete class as well, but I couldn't figure out how to make the arguments for a generic call function dynamic. So I ended up just writing specific function for each call, sort of defeats the purpose....but this is great.