XML “Compression” Tip

Maybe this is more common than I realize; I’m working on a Web project where the initial XML file is 420kb in size—that’s just way too big. I searched for various XML compression utilities, but a few seemed overcomplicated and many of the utilities don’t work on a Mac. In the past, I’ve imported PNG files into FLAs and published them as SWFs. This is an excellent way to reduce the load size of your PNG—while compiling the SWF, Flash compresses the embedded PNG. This gains ~50+% compression of that PNG depending on your publish settings. So, I thought why not add the XML to a variable on the main timeline of an empty SWF. My 420kb XML file is now wrapped within a 24kb SWF making the load time much less significant. Hope this helps someone.

This entry was posted in AS3, Flash and tagged , , , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

4 Comments

  1. Posted October 9, 2011 at 1:45 pm | Permalink

    Thank you!! After some googling I found a tool that batches it for me!!

    I have no experience whatsoever with JSFL, I’m not really a programmer actually, I just learn on the fly and enjoy coding in AS3 :)

    Thx again

  2. Posted October 9, 2011 at 11:10 am | Permalink

    Yeah, I’m quite impressed with how well it works. For your 160 pngs, I’m not sure if would be worth the time to figure out how to set it up if you’re not familiar with it, but I’m betting you can write a JSFL command to handle exporting all of your PNGs as SWFs. Dig around for a few JSFL tutorials… or you may even find a script that does just that.

  3. Posted October 9, 2011 at 10:50 am | Permalink

    Wow lol that saves a LOT of space…
    I’ve been working on trying to get my PNG’s as small as possible because I’m making an Android APP and the smallest I was able to create was 235kb (from a whooping 960). Now that I used this trick its 96 _O_ thank you!!!

    (It’s gonna be a lot of work to convert 160pngs but still it’s worth the kb’s I’m gonna save!!)

  4. Patrick Mullady
    Posted September 2, 2010 at 3:08 pm | Permalink

    great site!
    This XML compression tip is something I’ve used in my arsenal as well. Fun to see someone else doing the same thing!

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>