I am attempting to load some xml data into an array and then show that data in a Datagrid. I think I need to create a multidimensional array but I am stumped at this point.
Here is what the grid should look like:
[ItemNumber] [SystemUrl]
12365 TestingSomeUrl.com
12366 TestingSomeUrl2.com
Here is my actionscript:
And the XMLCode:MyXML = new XML(); MyXML.ignoreWhite = true; MyXML.onLoad = function(success) { if(success) { //arrays dB = new Array(); //parsing for (i=0; i< _root.MyXML.firstChild.childNodes.length; i++) { dB[i] = _root.MyXML.firstChild.childNodes[i].attributes; } } } MyXML.load("TableData.xml"); function setData() { grid.setDataProvider(dB); }
Code:__?xml version="1.0" encoding="iso-8859-1"?> __main> ________item1 ItemNumber="12364" SystemUrl="http://testingthis.com?1236" /> ________item2 ItemNumber="12365" SystemUrl="http://testingthis.com?1237" /> __/main>