I am have this code loading an xml file into a dynamic text box:
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;
}
GetDateText = function(news_xml, entry_index){
var entries = news_xml.firstChild.childNodes;
var date_element = entries[entry_index].firstChild.nextSibling.nextSibling;
return date_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);
var date = GetDateText(news_xml, i);
content_txt.htmlText += '<font size="14" font-family="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif" color="#FF3070"><b>' + title +"</font></b><br>"
content_txt.htmlText += '<font font-family="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif" size="10"><i>' + date +"</i></font><br>"
content_txt.htmlText += '<font font-family="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">' + body +"</font><br><br>";
}
}
RefreshNews = function(news_xml){
content_txt.htmlText = "<i>Loading...</i>";
news_xml.load(xml_file);
}
var xml_file = "achivevements.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);
my text box has the instance name - content_txt, and the scrollbar has the instance name myScroll.
How do I have the disable the scroll bar if it is not used? I have a custom skinned scroll bar and every AS i try displays two gray boxes when there is not enough content to scroll.