# Scroll bar help

**URL:** https://forum.kirupa.com/t/scroll-bar-help/245363
**Category:** Uncategorized
**Created:** [November 28, 2007, 9:22pm UTC](https://forum.kirupa.com/t/scroll-bar-help/245363 "2007-11-28T21:22:31Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![sparky\_157](https://avatars.discourse-cdn.com/v4/letter/s/c68b51/32.png) [@sparky\_157](https://forum.kirupa.com/u/sparky_157)
#### Post date: [November 28, 2007, 9:22pm UTC](https://forum.kirupa.com/t/scroll-bar-help/245363/1 "2007-11-28T21:22:31Z")

</div>

This is the code i am using to read an xml document.

```auto
GetTitleText = function(news_xml, entry_index){
    var entries = news_xml.firstChild.childNodes;
    var title_element = entries[entry_index].firstChild;
    return title_element.firstChild.nodeValue;
}
GetBodyText = function(news_xml, entry_index){
    var entries = news_xml.firstChild.childNodes;
    var body_element = entries[entry_index].firstChild.nextSibling;
    return body_element.firstChild.nodeValue;
}
GetEntry = function(news_xml, index){
    var entries = news_xml.firstChild.childNodes;
    return entries[index];
}
GetNewsCount = function(news_xml){
    var entries = news_xml.firstChild.childNodes;
    return entries.length;
}

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 body = GetBodyText(news_xml, i);
        content_txt.htmlText += "<b>" + title +"</b><br>"
        content_txt.htmlText += body +"<br><br>";
    }
}

RefreshNews = function(news_xml){
    content_txt.htmlText = "<i>Loading...</i>";
    news_xml.load(xml_file);
}

var xml_file = "news.xml";

var news_xml = new XML();
news_xml.ignoreWhite = true;
news_xml.contentType = "text/xml";
news_xml.onLoad = function(success){
    if (success) ShowNews(this);
    else content_txt.text = "Error loading XML file";
}

RefreshNews(news_xml);

```

and it works great. however when i try to add a UI scroll bar, the scroll bar does not work. Any sugestions?
