topical media & game development

talk show tell print

#ax-springgraph-sample-AmazonDemo-AmazonService.ax

#ax-springgraph-sample-AmazonDemo-AmazonService.ax [swf] flex


  
//////////////////////////////////////////////////////////////////////////

// // Copyright (C) 2006 Adobe Macromedia Software LLC and its licensors. // All Rights Reserved. The following is Source Code and is subject to all // restrictions on such code as contained in the End User License Agreement // accompanying this product. //
//////////////////////////////////////////////////////////////////////////

package { import mx.rpc.http.HTTPService; import mx.managers.CursorManager;
Encapsulation of the Amazon Web Service. Contains static functions for performing specific calls on the service.
author: Mark Shepherd

  
          public class @ax-ax-springgraph-sample-AmazonDemo-AmazonService
          {
                  private static var urlBase: String = "http://webservices.amazon.com/onca/xml?Service=AWSECommerceService&AWSAccessKeyId=00WQKXFRETRXJMXW8682&";
                  
                  public static function getItemInfo(id: String, client: Object): void {
                          var service: HTTPService = new HTTPService();
                          service.resultFormat="e4x";
                          service.url = urlBase + "Operation=ItemLookup&ResponseGroup=Reviews,Images,Large&ItemId=" + id;
                          service.addEventListener("result", client.getItemInfoResult);
                          service.addEventListener("fault", client.getItemInfoFault);
                          service.send();
                  }
                  
                  public static function getDetailPageUrl(id: String): String {
                          return "http://www.amazon.com/gp/pdp/profile/" + id;
                  }
          }
  }
  


(C) Æliens 27/08/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.