11.19.2012

On embedding XML

If you're embedding huge gobs of XML (damned if I know why you'd need to do this): Pasting the XML into a class as a static XML object seems to offer the best performance and compression. The compile-time processing and optimization is significant.

12.05.2011

Recompress your Flash 11 SWFs with LZMA

Flash 11 can load SWFs that have LZMA compression; previously SWF contents were either uncompressed or zlib-compressed.

Since the mxmlc compiler doesn't yet support this compression, and since it was a PITA to compile Tinic Uro's zlib2lzma on anything but Windows (http://blog.kaourantin.net/?p=124), and since no one else seems to have done it... I wrote a Python script to do the conversion. Woot. It only requires that the input SWF be compiled with -swf-version=13 (or higher). It will fail if you feed it an LZMA-compressed SWF -- feel free to fork me on GitHub and fix that.

Usage: python swf2lzma.py in.swf out.swf

Grab the code from: http://github.com/jspiro/swf2lzma

7.19.2011

build decay chronograph

After hours of coding and reloading, I constantly forget whether I reloaded a browser tab under development, and otherwise question whether the SWF actually got rebuilt (and am often wrong on both counts).


Enter the BuildDecayChronograph, an object that shows you how long it's been since a given SWF was last built, and a quick visual indicator from green to red of how fresh it is (for me, 5 minutes). The only requirement is that the given SWF was compiled with mxmlc.

Usage:
addChild(new BuildDecayChronograph(5*60, 'engine'));

Download from GitHub.


This could not have been done without the brilliantly hacky org.igorcosta.hacks.SWF
Blog Text and Codes (Igor Costa ) / CC BY-NC-SA 3.0