Posted By

Ether on 08/14/09


Tagged

as3 service RemoteObject


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

quan


RemoteService


 / Published in: ActionScript 3
 

URL: http://gertonscorner.wordpress.com/2008/09/06/remoteobject-using-amfphp-and-actionscript-3/

Create a generic service for Flex3 & 4

  1. public function RemoteService( serviceId:String
  2. , serviceDestination:String
  3. , amfChannelId:String
  4. , amfChannelEndpoint:String
  5. )
  6. {
  7. // Create a runtime Channelset for given Channel ID and Endpoinr URI
  8. var amfChannel:AMFChannel = new AMFChannel(amfChannelId, amfChannelEndpoint);
  9. amfChannelSet = new ChannelSet();
  10. amfChannelSet.addChannel(amfChannel);
  11. // Create the remoteObject instance
  12. this.remoteObject = new RemoteObject(serviceId);
  13. this.remoteObject.channelSet = amfChannelSet;
  14. this.remoteObject.destination = serviceDestination;
  15. this.remoteObject.addEventListener(FaultEvent.FAULT,onRemoteException);
  16. }

Report this snippet  

You need to login to post a comment.