Hey Chris.

Sorry about that, I didnt realize you were using xml as  your datasource nor
did I realize you were working with dates.

Using xml you could convert your xml object into an XML List and then use
the sort methods I outlined.  But working with dates can make it tricky.  On
a flex 1.5 app I had to work on we had to change the format of the date data
that was returned so it was in the format of YYYYMMDD that way it actually
sorted correctly.  Cant say I have tried to sort dates in flex 2. thats
something I would hope might have been updated.

good luck.

simeon


On 1/9/07, Chris MacGregor <[EMAIL PROTECTED]> wrote:

  Anyone,

I'm still having trouble getting my head around the way FLEX handles
XML objects. Here's my issue, I'm consuming an XML document with a
years worth of historical stock prices for a HLOCChart. The data comes
into the FLEX in reverse chronological order with the dates in the
format 'month/day/year' (e.g. '12/29/2006' or '1/3/2006'). I've tried
the sort functions Simeon pointed me to, but they're not applicable to
the date being formatted this way (because in this format November
(11) and December (12) are between January (1) and February(2) ).

What I need to do is essentially 'flip' the order of the nodes so my
chart can display with the oldest date on the left and the most recent
on the right. I can't seem to apply a 'reverse()' method to the XML
because it's not an Array and I can't figure out how to make the dates
'real' dates. The Flex documentation is as obscure on this matter too.
I would think that this would be an easy solution, but I can't seem to
find it.

Frustration is setting in. Any thoughts on techniques I should try?

Chris

Reply via email to