Thank you, that helped a lot. For anyone else trying to filter by date, here's
the line of code:
var today:Date = new Date();
var showXML:XMLList = result_xml.item.(new Date(date.toString()) >= today);
Thanks,
Doug Coning
Senior Flash / ASP.Net Developer
Webize Interactive Media
345 Massachusetts Avenue
Indianapolis, Indiana
dcon...@webize.com
-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of David
Hershberger
Sent: Monday, March 09, 2009 5:02 PM
To: Flash Coders List
Subject: Re: [Flashcoders] AS3 - XML Filter by Date
You can filter XML with arbitrary boolean functions, so the answer is
definitely yes.
See http://livedocs.adobe.com/flex/3/html/13_Working_with_XML_08.html#131880
One of the examples there shows XML stored in var x with a list of type elements, and you can use this syntax to get an XMLList of
employees with id attributes over 300:
x.employee.(@id > 300)
Similarly, if you had a birthdate field stored as milliseconds since 1970
you could filter on that like so:
x.employee.(new Date(@birthdate).getFullYear() == 2000)
to return a list of employees who were born in the year 2000. (Presumably a
short list. :-)
Dave
On Mon, Mar 9, 2009 at 1:07 PM, Eric E. Dolecki wrote:
> I suppose if the XML has that kind of data in it you could.
>
> On Mon, Mar 9, 2009 at 12:02 PM, Doug Coning wrote:
>
> > Greetings everyone,
> >
> > In AS3, can you filter xml by a date value or range?
> >
> > Thanks,
> >
> > Doug Coning
> >
> > ___
> > Flashcoders mailing list
> > Flashcoders@chattyfig.figleaf.com
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
>
>
>
> --
> http://ericd.net
> Interactive design and development
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders