The ActionScript client bundle is an SWC containing the source files for the ActionScript classes that can be used with Adobe Flex to develop, for example, a Flash UI that interfaces with this public API. The ActionScript classes have been generated with an emphasis on usability, clarity, and type safety (inasmuch as ActionScript allows it). All public data types have been generated along with the services that access them. This means that rather than using a standard RemoteObject, you can instantiate a service, register the appropriate events, and invoke the method. The service will fire the appropriate (strongly-typed) event that contains the response.
As an example, suppose there existed a service interface and method for reading a purchase order. A typical use of the library would like like this:
//instantiate a new service...
PurchaseOrderService service =
new PurchaseOrderService();
service.addEventListener("readPurchaseOrder",
doReadPurchaseOrder);
service.addEventListener("fault", doFault);
private function doFault(event:Event):void {
Alert.show("A fault occurred.");
}
private function doReadPurchaseOrder
(event:ReadPurchaseOrderResultEvent):void {
PurchaseOrder po = event.result;
//handle the purchase order that was returned.
}
//make the asynchronous remote call to
//read the purchase order...
service.readPurchaseOrder("123456");