« Flash Xml Remoting v3.1 Actionscript is now public»

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 :

XML:
  1. <items>
  2.    <item>
  3.       <value>1</value>
  4.    </item>
  5. </items>


Will parse a value of Number type in Flash by :

Actionscript:
  1. items.item.value //will equal 1

This is what happens with repeating item nodes

XML:
  1. <items>
  2.    <item>
  3.       <value>1</value>
  4.    </item>
  5.    <item>
  6.       <value>2</value>
  7.    </item>
  8.    <item>
  9.       <value>3</value>
  10.    </item>
  11. </items>


Will parse to an Array :

Actionscript:
  1. items.item.length // will equal 3
  2. 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

XML:
  1. <items>
  2.    <item name="foo" date="2007-03-07T23:38:02.703+11:00" active="true">
  3.       <value>1</value>
  4.       <value>2</value>
  5.       <value>3</value>
  6.    </item>
  7.    <item>
  8.       <value>2</value>
  9.    </item>
  10. </items>


Will parse to :

Actionscript:
  1. var itemsList:Array = items.item;
  2. var valueItems:Array = itemsList[0].value
  3. valueItems.length // will equal 3 - Number
  4. itemsList[0].name // will equal foo - String
  5. itemsList[0].date.getDate(); // will equal 7 - Number from Date Object for date
  6. 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 :

  • Source code is now public.
  • XML can be compressed using the LZ77 Algorithim saving almost 80% on the size of the XML data. XML can be encoded using source files from www.strille.net
  • Have simplified and improved the recursive parsing engine.
  • Have enabled support for parsing to Flash Date type i.e. dates in the string format "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.
  • MXP installed version includes Flash Panel Help.
  • What v4.0 will include :

  • Major overhaul of parsing engine to allow for lazy decoding, so that XML doesnt parse until it is requested.
  • Include DataSet classes to allow for applying expressions to sort and filter data.
  • Options to allow setting of concurrency between multiple, single and last. Version 3.1 is always multiple.
  • Documentation is available in many formats including :

  • Online HTML
  • HTML download
  • Xml Remoting for Flash is available in a few formats including :

  • FLA compiled component
  • Open source actionscript
  • Open source actionscript with example FLA
  • MXP
  • SWC
  • Samples are also available for download :

  • DropDownlist Integration Example
  • Simple Debug Example
  • Simple Example
  • 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.