Patterson Consulting, Inc
  • Blog
  • |
  • About
  • |
  • Labs
  • |
  • Published Work
  • |
  • Recent Projects
  • |
  • Presentations
  • |
  • Contact
Patterson Consutling, Inc

    Search


    Category

  • ActionScript
  • Adobe
  • AIR
  • Apollo
  • ColdFusion
  • Conferences
  • ECMAScript
  • Facebook
  • Flash
  • Flex
  • General
  • Javascript/DHTML
  • MN.swf
  • Silverlight
  • Technology
  • XML/XSLT/XML Schema

    Archive

  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • 2004


GZIP-Encoded HTTP Response in Adobe AIR

by Danny Patterson on February 22nd, 2008

A common way to reduce the size of data returned over HTTP is to allow the web server to use a GZIP compression on the data. When making requests in a Flash/Flex application hosted in a web browser, the browser actually uncompresses the GZIP-encoded data before its delivered to Flash Player. Therefore, Flash/Flex developers don’t need to worry about GZIP-encoded data since its handled seemlessly behind the scenes. However, when writing an application in AIR, there is no browser to handle the GZIP compression and AIR 1.0 doesn’t have this built-in. (I assume they will add this in a dot release at some point.)

But there is a way to do it manually. The ByteArray in AS3 supports DEFLATE compression. However, you must first remove the header in the GZIP data for this to work properly. In my case, I was making a web service call using the WebService class in Flex. Since I actually needed to get at the raw binary GZIP data returned by the server, I had to change my code to use the low-level URLLoader class that is built-in to Flash Player.

more…

5 Comments


Making Flex Web Service calls in ActionScript

by Danny Patterson on February 14th, 2008

I was using Flex the other day to consume some SOAP web services. However, I needed a way to modify the SOAP header in the request. This is exposed by calling the addHeader method on the service. That was easy enough, but I was finding my code difficult to manage when the service was defined using MXML and I had to add the header in ActionScript. I never really liked using MXML to define non-ui elements, so I decided to just use ActionScript to define the entire service. I found that it wasn’t as straight forward as I thought it would be so I thought I’d post my code here for the benefit of the community.

more…

5 Comments


Atom | RSS | © 2008 Patterson Consulting, Inc