Amazon ECS Library in Actionscript 2
A few months ago I started writing a library in actionscript 2 for amazon’s ECS. I never got around to finishing it though. Yesterday, my friend from USC asked me for it so I decided it was time to finish it up. The library is actually pretty simple and consists of two parts.
1) awsParamCollection. The purpose of this class is to enumerate all of the potential request parameters. This makes building requests really easy so you don’t have to worry about building messy strings filled with url vars and whatnot.
2) awsapi. This class actually handles the making and deserializing of the ECS requests.
A simple call would look something like this:
var aws = new awsapi(this); var requestParams = new awsParamCollection(); requestParams.ResponseGroup = awsapi.SMALL_RG; requestParams.ItemId = "B00008OE6I"; function onItemLookupResponse(responseObj:Object){ //do stuff on response } function onErrorResponse(responseObj:Object) { //do stuff on error } aws.executeOperation(awsapi.ITEMLOOKUP_OPERATION, requestParams);
I plan to write an Actionscript 3 version pretty soon so that all of you Flash 9 and Flex 2 people can play with it.
The code is available for download here.