« Flash Xml Remoting v3.1 Actionscript is now public»
- Published on › 03.03.07 | Filed under › Source
Flash Xml Remoting is a Component for Flash 2004 and 8 (AS2.0) that converts XML to Objects/Arrays. This makes it a lot easier to work with Xml because you don't have to write custom Xml parsing code.
For example :
<items> <item> <value>1</value> </item> </items>
Will parse a value of Number type in Flash by :
items.item.value //will equal 1
This is what happens with repeating item nodes
<items> <item> <value>1</value> </item> <item> <value>2</value> </item> <item> <value>3</value> </item> </items>
Will parse to an Array :
items.item.length // will equal 3 items.item[1].value // will equal 2
The Xml parser will do so recursively so it doesn't matter how deep the Xml tree is it will still work
<items> <item name="foo" date="2007-03-07T23:38:02.703+11:00" active="true"> <value>1</value> <value>2</value> <value>3</value> </item> <item> <value>2</value> </item> </items>
Will parse to :
var itemsList:Array = items.item; var valueItems:Array = itemsList[0].value valueItems.length // will equal 3 - Number itemsList[0].name // will equal foo - String itemsList[0].date.getDate(); // will equal 7 - Number from Date Object for date itemsList[0].active // will equal true - Boolean
It's been a while between updates but there have been quite a few improvements in v3.1 including performance, functionality improvements and a few bug fixes. As well in this version the Actionscript has been provided open source.The parser model is recursive and allows for the parsing of all formats of Xml to a data typed Object/Array.Flash Xml Remoting also hooks in with Macromedia’s NetDebugger Class allowing to view the parsed Xml in the NetConnection Debugger.The Macromedia Flash Remoting Debugger can be downloaded and installed at : http://www.macromedia.com/software/flashremoting/downloads/components/
You will require the appropriate OS flash remoting installation and version MX 2004 or 8 with Actionscript 2.0Currently Flash Xml Remoting is free of charge to use, though would appreciate any bugs or feature requests be forwarded to shanem@flashdynamix.com so we can better tailor this product to users needs.Flash Xml Remoting v3.1 includes quite a few updates these include :
"2007-03-03T21:12:23.500+11:00" will parse to the date type. This is done by the new Date2 class included in the com folder. It allows for parsing and encoding date/times.What v4.0 will include :
Documentation is available in many formats including :
Xml Remoting for Flash is available in a few formats including :
Samples are also available for download :
Download all of the above click here
More updates will be online before long, please feel free to post you're comments and requests here or queries direct to shanem[at]flashdynamix.com.


7 Comments