This content has been marked as final. Show 3 replies
my php return this:
while( $Row = mysql_fetch_object( $Result ) )
And I check, that exacly this is returned in evenResult, but I still cant
convert this into ArrayCollection :-(((
The quickest solution is to:
1) Change the model variable to:
public var _xlcDg:XMLListCollection
1) set resultFormat="e4x" on the HTTPService instance
2) in the handler, do:
var xmlResult:XML = XML(event.result);
trace(xmlResult.toXMLString()); //to see what you have
var xlPersons:XMLList = xmlResult.person; //you can use the XMLlist directly, but it is not best practice
trace(xlPersons.length); //what you expect?
_xlcDg = new XMLListCollection(xlPersons);
If you want an ArrayCollection, create a class to be your value object, then loop through the XMLList and create a new instance of the VO, assign the propderty values form the xml node, then addItem() to put it in the array collection.
Of course your way with XMLListCollection works!
Now I will try to create own class, to use ArrayCollection.
Thank you Tracy.
> If you want an ArrayCollection, create a class to be your value object,
> loop through the XMLList and create a new instance of the VO, assign the
> propderty values form the xml node, then addItem() to put it in the array