I am having problems manually looping through xml data that is received via an HTTPService call, the xml looks something like this:
<DataTable>
<Row>
<text>foo</text>
</Row>
<Row>
<text>bar</text>
</Row>
</DataTable>
When the webservie result event is fired I do something like this:
for(var i:int=0;i<event.result.DataTable.Row.length;i++)
{
if(event.result.DataTable.Row[i].text == "foo")
mx.controls.Alert.show('foo found!');
}
This code works then there is more then 1 "Row" nodes returned, however it seems that if there is only one "Row" node then the event.DataTable.Row object is not an error and the code subsequently breaks.
What is the proper way to loop through the HTTPService result object? Do I need to convert it to some type of XMLList collection or an ArrayCollection? I have tried setting the resultFormat to "e4x" and that has yet to fix the problem...
Thanks