<fx:XML id="dataGridDataFieldsXML" source="assets/dataGridDataFieldsXML.xml"/>
<s:XMLListCollection id="showGridFields" source="{dataGridDataFieldsXML.viewer}"/>
I want to loop through my XML file and get the "field" value.I tried the following but nothing is getting through the trace statement:
var xmlTrack:XML;
for each( xmlTrack in dataGridDataFieldsXML.fields_by_viewer.viewer )
{
trace(xmlTrack.@field);
}
My XML
<?xml version="1.0" encoding="UTF-8"?>
<fields_by_viewer>
<viewer id="1" field="fieldName1"/>
<viewer id="1" field="fieldName2"/>
</fields_by_viewer>
Anything wrong here?
Thanks
flexyboz