October 14, 2008

SimpleXMLDecoder

Filed under: ActionScript, Flex — Anthony @ 12:42 am

I haven't written a post in a little while so I figured it was about time. I have recently started a project that has to deal with a lot of XML data and converting all that data into configuration objects VO's and other objects can be a bit of a pain. I use e4x a lot but I also find a little known Flex class called SimpleXMLDecoder really useful when I want to quickly convert an XML into an object.

var xmlDoc : XMLDocument = new XMLDocument( xmlhere );
var simpleXML : SimpleXMLDecoder = new SimpleXMLDecoder( false );
var xmlObject : Object = simpleXML.decode( xmlDoc );

No Comments »

No comments yet.

RSS feed for comments on this post. | TrackBack URI

Leave a comment

XHTML ( You can use these tags): <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .