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];
You probably are using this inside a module or a swf that you've loaded, and the loader has a different applicationDomain than the parent, and some other loaded module or swf is also using XMLList or XMLListCollection. Without more details on your architecture, I can only tell you to make sure the parent applicationDomain loads in XMLList and/or XMLListCollection before either child, or make sure they both share the parent's applicationDomain.