ActionScript is the programming language for the Adobe Flash Player run-time environment. This library is useful for client applications written in Adobe Flash or Adobe Flex.
Note: The ATG Platform REST Web Services were tested with ActionScript 3.
The ActionScript client library is nearly identical in structure to the Java client library. The main difference between the two libraries is the way they handle results:
The Java client library uses the
RestResult
class to handle results.The ActionScript library does not include a
RestResult
class; instead, it handles results using a callback mechanism. Therefore, helper class methods and thecreateHttpRequest()
method for the ActionScript client library take a result handler and fault/error handler functions as arguments.
The following code sample illustrates how the ActionScript client library handles results.
public function getPropertyValue():void { RestComponentHelper.getPropertyValue("/atg/dynamo/Configuration", "httpPort", null, session, handleResult, handleFault); // get the httpPort property from the Configuration component } public function handleResult(pEvent:Event):void { var xml:XML = new XML(pEvent.target.data); // create an XML object populateGridWithXML(xml); // populate the control with the XML output } public function handleFault(pEvent:Event):void { Alert.show("Fault"); // display an error dialog }