Get the time from XML and read out appropriate node in AS3

Hi there. I have an XML file of various auction items that will display based on the time. I want to use AS3 to getUTCDate based on the hour set in the <time> field of the XML file and then display the appropriate XML node. I’m pretty much intermediate with AS3+XML so I could use some help. I’ve got everything setup but something isn’t quite right.

AS3


import flash.net.URLRequest;
import flash.net.URLLoader;
import flash.events.Event;
import flash.text.TextFormat;

var xmlData:XML = new XML();
var theURL_ur:URLRequest = new URLRequest("sample_auction.xml");
var loader_ul:URLLoader = new URLLoader(theURL_ur);
loader_ul.addEventListener("complete", fileLoaded);


var my_date:Date = new Date();
var currentHour:Number = my_date.getUTCHours() + (my_date.getUTCMinutes() / 60);
trace(currentHour);


function fileLoaded(e:Event):void
{
    xmlData = XML(loader_ul.data);
    for(var i:uint = 0; i < xmlData.auction.length(); i++)
    {   
        if(xmlData.auction*.time < currentHour)
        {
        auctionName_txt.text = xmlData.auction*.title;
        auctionDesc_txt.text = xmlData.auction*.description;
        }
    }
       
}

do I need to declare the various times from xml such as doing a var on each time or something? Here is some sample XML code. (also I’m not calling the image yet I’m just trying to get this thing to read the appropriate nodes first.) It’s not throwing a complier error but it’s also not sure what to do yet.

The XML:proud:


<auctionlist>
<auction>
<time>6:00</time>
<title>Example Auction 1</title>
<description>Placeholder Text blah blah.</description>
<image>sampleimage1.jpg</image>
</auction>


<auction>
<time>7:00</time>
<title>Example Auction 2</title>
<description>Placeholder text blbalblbladflknsdf</description>
<image>imagepath11.jpg</image>
</auction>


<auction>
<time>8:00</time>
<title>Sample Auction 3</title>
<description>Placeholder text asflkamdflkmasdfm</description>
<image>imagepath12.jpg</image>
</auction>


<auction>
<time>9:00</time>
<title>Sample Auction 4</title>
<description>Placeholder text blabjadsflkm afdlkmasf afmlksf mmasdflkm</description>
<image>imagepath12.jpg</image>
</auction>

any help would be greatly appreciated.