My Flex app runs a service to a php page that pulls data from my database, then structures the result in an XML format. I created a new XMLList called testList
outs
E4X expressions return lists of matching XML. xml.user
gives you an XMLList of all user
elements. You can use XMLListCollection
, which implements IList
, to wrap the result so you can use it as a dataprovider.
var xml:XML = new XML(event.result as String);
var list:IList = new XMLListCollection(xml.user);
The other option is to loop though the XMLList and add it to an array or whatever collection you need. If you know for sure that there is only one user, you can do this instead:
var user:XML = xml.user[0];