PDA

View Full Version : Array collection sort


kminev
07-07-2008, 02:05 AM
I have a web service which returns xml data to my flex chart and then I convert the xml to ArrayCollection. I have the following xml structure:

<NFS>
- <Trade>
<OrNo>0000000Y</OrNo>
<Date>6/10/2008 6:25:00 AM</Date>
<IP>xx.xxx.xx.xxx</IP>
<Ex>CBOT-A</Ex>
<A>Add</A>
<Trd>xxx</Trd>
<W2G>15</W2G>
<W2E>15</W2E>
<G2E>0</G2E>
</Trade>
</NFS>

When I load my data to the chart I need to separate the data on 3 different chunks. The field that I need to sort by is <A> .

Do I have to do that with a loop and if the <A> is met then assign the values to the chart series. Any idea how would be the most efficient way of doing it.

Perhaps I can do it with my xml as well.

Thanks in advance for any ideas.

box86rowh
07-07-2008, 02:31 AM
you can use xpath queries on the data to filter your data. Just research xpath and e4x

kminev
07-07-2008, 03:36 AM
Does xpath and e4x also works for array collections or only for xml based objects?

box86rowh
07-07-2008, 05:12 AM
it will work just for xmlLists and xml objects

kminev
07-07-2008, 02:59 PM
Can I sort my array collection using the AMF I just heard that amf is for data objects and it is much faster than dealing with xml objects. Anybody who knows a good reference on the web with AMF samples?

Thanks