Remote Delegate Class

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.

Actionscript:
  1. private var remoteDelegate:RemoteDelegate;
  2.  
  3. remoteDelegate = new RemoteDelegate( this, CF_API );
  4.  
  5. remoteDelegate.call( "cfMethod", param1, param2, param3 );

RemoteDelegate.as

* NOTE *

Thanks to docsultant for the dynamic method invocation heads up.

This entry was posted in Coldfusion, Flex and tagged , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

One Comment

  1. Russ
    Posted June 24, 2009 at 6:00 pm | Permalink

    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.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  • FreeAgent sign-up


  • Recent Posts

  • Categories