FZip: Zip Archives for ActionScript 3

Wow, Claus Wahlers and Max Herkender are quickly closing the gap between ActionScript 3 and other development platforms’ libraries (read Java and .NET) with their newly-released FZip library. If you haven’t already heard, FZip allows for progressively decompressing zip archives directly in the Flash Player. What’s even better, it’s licensed under the free and very unobstrusive zlib/libpng license and as such, is unencumbered for use in commercial products.

While it does require a slight modification to zip files on the server-side to include Adler32 checksums for zlib compatibility, this can be readily managed with a few lines of server-side scripting and made to be almost invisible.

One immediately useful application for FZip is managing skins for icon and graphic heavy RIAs as suggested in Claus’ demo. The small file size typical of icons makes downloading them one-by-one over HTTP extraordinarily inefficient, as the handshaking and headers needed for making each request are sometimes as large as the image itself. Previously, the chief alternatives to this madness were either placing your icons and other graphical assets in the main application’s library itself (as Macromedia was wont to do with their component sets), or if dynamic skinning was desired, in a shared library SWF. While SWF based approaches solved load time problems, they created another: modifying skins and icons now required the ability to edit and/or recompile SWFs. This isn’t much of an issue for a professional Flash designer or developer, but effectively placed the ability to reskin a RIA outside the reach of most users.

However, if you now place all of your skin icons in a FZip archive and load them into your application from there, not only can all of your icons and graphics be retrieved as a single request, making a new skin is now no more difficult than opening up a zip file and modifying some of the contents. This makes life much easier for making changes to icons and seeing the results without having to recompile your entire application for each miniscule change.

Leave a Comment