# XML scorebord, lowest times?

**URL:** <https://forum.kirupa.com/t/xml-scorebord-lowest-times/222154>\
**Category:** flash\
**Created:** [April 11, 2007, 9:40am UTC](https://forum.kirupa.com/t/xml-scorebord-lowest-times/222154 "2007-04-11T09:40:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![magjac](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@magjac](https://forum.kirupa.com/u/magjac)\
**Post date:** [April 11, 2007, 9:40am UTC](https://forum.kirupa.com/t/xml-scorebord-lowest-times/222154/1 "2007-04-11T09:40:06Z")

</div>

Hi, I need help with sorting out the lowest times (tid) and put them at the top of my scoreboard. All my scores are saved in a XML document and this is the code in the AS that puts the text into a textfield called “content\_text”.

```auto
ShowNews = function(news_xml){
    if (!news_xml.firstChild.hasChildNodes()){
        content_txt.text = "No news available.";
        return (0);
    }
    var entries = news_xml.firstChild.childNodes;
    content_txt.text = "";
    for (var i=0; i<entries.length; i++){
        var title = GetTitleText(news_xml, i);
        var tid = GetTidText(news_xml, i);
        content_txt.htmlText += "<b>" + title +"</b><br>"
        content_txt.htmlText += "Tid:" + tid +"<br>";
        content_txt.htmlText += "----------------------------<br>"
        
    }

```

And this is the code that fetches the info from the XML:

```auto
GetTidText = function(news_xml, entry_index){
    var entries = news_xml.firstChild.childNodes;
    var tid_element = entries[entry_index].firstChild.nextSibling.nextSibling.nextSibling.nextSibling;
    return tid_element.firstChild.nodeValue;
}

```

Anyone know how to make it pick the ones with the lowest times and bring them to the top?
