AS2
If you've come from a longer history with Actionscript & XML. you may have written some pretty elaborate / gnarly AS1/AS2 XML parsers in the past- and you probably know what a pain that can be. (especially when someone tells you to change the spec!)
If you are stuck in corporate America and thus still working in AS2, save yourself more headaches and get Jack Doyle's Greensock XML manager. XPATH is great too, but this might be easier. It allows you to convert XML to Object with arrays and properties, and reference nodes by name. All in all, it's very well documented / explained with examples and very easy to use- yet another useful and stable class from Jack:
http://blog.greensock.com/xmlparseras2/
AS3
If you are in AS3, you don't need much to parse XML anymore, thanks to E4X (an ECMA script approach to XML). In fact...
...if you've written any for() loops to parse XML, you've already gone too far!!!
Here's a great tutorial on E4X from Senocular:
http://www.senocular.com/flash/tutorials/as3withflashcs3/?page=4#e4x
Here's another at dispatchEvent:
http://dispatchevent.org/roger/as3-e4x-rundown/
Posted on
Saturday, December 5, 2009
by Sean P
filed under