AS3/Flash: XML as datagrid data provider

703 Views Asked by At

listI have something like this:

<list>
    <Name Date="18/12/2013">ALPHA</Name>
    <Name Date="05/05/2014">ALLAN LTD</Name>
    <Name Date="01/05/2014">ALLAN &amp; PINKER</Name>
    ...        
</list>

I need to populate a datagrid formated like:

Name | Date

I have no problems setting the name column values, but I can't get the date column filled.

The function I'm using says:

var list:Array = new Array();
listXML..Name.(list.push({Name:text()}));
fullList.dataGrid.dataProvider = new DataProvider(list);

How may I populate the Date column?

Cheers

1

There are 1 best solutions below

1
On

You can access date attribute by using

listXml.list.name[i].@Date

for more info check XML - targeting node attribute, push into a Flash AS3 array