Tag Archives: AS3

XML Serialisation in ActionScript 3

XML Serialisation – a nest of rubbishness no more.

In my experience, code to do this takes the form of massive source files devoted solely to mechanically copying properties out of one type of entity into another, which needed to be updated every time you tweaked the data model. blergh.

As such, I have written an ActionScript 3 helper library (h2j9k.XMLSerialiser) which dynamically serialises any in-memory object, and can de-serialise it back again into the same state from that XML (as long as all the important data is held in public fields or read-write properties, obviously). It preserves types, and includes child objects inline, and requires no configuration whatsoever.

I’m hosting the project at my site for open source code, so why not go take a look? It is MIT licensed so you can use it in your code at work…although it would be nice if you credited it back to h2j9k.org.


Setting up your own flash project for free.

OK, so I am not the best person in the world in terms of finishing things off. I start a project, get somewhere (so it is doing something vaguely useful) and then forget entirely about it and leave it to rot.

But one idea that I keep coming back to is a particular project in flash (no details until I release a beta, when you will get a link and be able to see all the code), and I have installed the CS4 demo (30 day trial) that one is allowed to use to test out CS4 before purchase, and I am now in a race against the clock to finish it off before my trial expires!

I am familiar with CS4, as I use it at work, so I have a much shorter ramp-up curve than anyone else just joining in the fun (I will make available some documentation on ActionScript 3 soon, when I get around to finishing off my KB website for developers), but I hope that someone else might be up for “trying to make something in flash in 30 days”, so here are rough steps for setting up the dev environment (I’m assuming windows here, but they should work similarly on Mac OS X):

  • Go to the Adobe website and find the page to purchase Flash CS4.
  • Click on the “Try” link next to buy and upgrade, and sign up for an adobe account. Don’t worry about the fact that they have your email address, or use your “spare” account if you have one; I have never had any spam from Adobe after signing up for this.
  • Install the silly little download manager and obtain the installer. before you run it, make sure you check the following:
    1. Remove any external HDDs, USB sticks or truecrypt or linux volumes you have mounted by some magic or other. The system optimiser that runs at the start of the install process tanks if it finds any weirdness on any FS it can see.
    2. Make sure you have the latest graphics card drivers installed before you run the install; CS4 is pretty hefty as UIs go (entirely custom and native to Windows) so that CS4 optimises itself properly for your computer and isn’t painfully slow.
  • Finally, when you get to the License part of the installer, choose “I want to try for 30 days”.

Now enjoy the CS4 goodness! Make sure you use ActionScript 3 not 2 when making your applications (AS3 is much more stable, better structured and generally a bit more of a proper programming language), even if you are just going to do most stuff by drag and dropping images and components into place.

Happy flashing!