1 person found this helpful
I would use XMLListCollection, not ArrayCollection:
var xl:XMLList = evt.result.toIPipe.sum as XMLList;
xlc = new XMLListCollection(xl);
xlc is defined outside the function (global)
sum is the repeating node.
Thanks Greg, I'll give that a try tonight.
The reason I'm using an ArrayCollection is because I need to then filter what is shown in the data grid based upon what the user selects using some other controls on the page.
I'll now do some research to see if filtering the data in and XMLListCollection is any harder/different.
You can't use e4x syntax to filter an XMLListCollection, but you could filter it by getting its contents as an XMLList and then filtering, possibly putting the result into another XMLListCollection so you can use its methods.
Above suggestion does not work for me.
Am currently using this solution
feed = event.result as XML;
case 0 :
trace('No results found');
case 1 :
items = new ArrayCollection(ArrayUtil.toArray(feed.channel.item));
items = convertXmlToArrayCollection(feed);
Help me with a util function or something.
what if you use XMLList instead of XML ? benefite of it is :
"The XMLList class contains methods for working with one or more XML elements. An XMLList object can represent one or more XML objects or elements (including multiple nodes or attributes), so you can call methods on the elements as a group or on the individual elements in the collection.
If an XMLList object has only one XML element, you can use the XML class methods on the XMLList object directly. ..."