views:

22

answers:

1

My Flash designer is reading an XML stream I'm sending back to the browser (I'm a C# dev). We have this working fine.

He is then selecting into an XMLList where a element has its id a certain value i.e. . This is also working just fine.

In this XmlList, are Events, that look a little something like this:

event
    startdate
      enddate
end event

I don't know how to use the formatting here - but each of those items is an element. startdate would have a value such as 04/02/2010 and enddate 6/30/2010.

Now, from this XmlList I do have of Events, I need to select all Events where a new variable myDate, falls in between the startdate and enddate.

I'm not sure how to do this in AS3 - can anyone help me?

Thank you very much in advance!

A: 

if i were you id put them all into a array as objects, for example:

var eventArray = new Array();
for each(var i=0; i<xmlList.event.length(); i++){
    var object = {startdate : xmlList.event[i].startdate, enddate : xmlList.event[i].enddate,};
    eventArray.push(object);
}

then using the Array.map call to a function that checks the startdate enddate pair against a time. see the Date class for easy comparason.

shortstick