SimpleXMLDecoder for Flash


Having worked with Flex for almost two years uninterruptedly I developed this mental dependency for its packages and classes. I don't see it as something unnatural, but a little while back I had to work on a Flash project and to be honest I had a lot of moments of "man I wish I had *this* Flex class around".

One of those moments was related to parsing XML files and I just couldn't stop thinking about sweet SimpleXMLDecoder I had, just waiting for me to give it something to decode. I was really lazy then (and maybe for all the good reasons) and decided not to build an XML parser myself nor search for one but simply to change the SimpleXMLDecoder I was so used to in order to work for my Flash project.

All I had to do was to strip the Flex dependencies which were related to the ArrayCollection class (Flash doesn't have it) and I was all set.

The class worked exactly as I wanted it to and it did help my Flex centered ego :)

Feel free to downlod the source if you think you need it.

Information and Links

Join the fray by commenting, tracking what others have to say, or linking to it from your blog.


Other Posts

Write a Comment

Take a moment to comment and tell us what you think. Some basic HTML is allowed for formatting.

Reader Comments

Hi Cristian,

Great job on the SimpleXMLDecoder class. I’ve added the possibility to load the xml file. And use the attributes.

http://www.freshlemons.nl/?p=71

Cheers,
Jaap

[...] Because of this highly inefficient way of working I decided to create a global class to load xml and convert it to an object tree. When I started with this target I searched around and discovered the Flex class SimpleXMLDecoder. As it turns out, Flex has its own class to convert an XML into an object tree. While looking for more material I found someone who converted the flex class into AS3 this can be found here [...]

Salut Cristi,

Nu am gasit o adresa de mail pe nicaieri.
Vroiam sa te intreb: ai dezvoltat sau vrei sa dezvolti applicatii colaborative?

@Cristian Andreica

salut, ti-am scris mail. mersi fain de vizita, numai bine.
cristi