Help loading random news/quotes in flash

hi, i’m new at trying to use arrays. i am trying to set up a randomly loading quote/news section, that pulls from an xml, but also checks to make sure it’s not reloading an already shown news item. basically i’m trying to set up an array for this check, but it doesn’t seem to be working, can anyone help me? here is the code:

var max_news_items = 50;
temp_i = [0];

contain_i = function(input, arrayData){
for (g=0; g<arrayData.length; g++) {
if (arrayData[g] == input) {
return 1;
}
}
return 0;

}

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 = “Error Loading Quotes.”;
content_txt._alpha =100;
return (0);
}
var entries = news_xml.firstChild.childNodes;
content_txt.text = “”;
content_txt._alpha = 0;
var i= Math.floor(Math.random()*entries.length);
this.onEnterFrame = function(){
if(contain_i(i,temp_i)!=0){
i= Math.floor(Math.random()*entries.length);
}
}

    var title = GetTitleText(news_xml, i);
    var body = GetBodyText(news_xml, i);
    content_txt.htmlText += "&lt;P ALIGN='RIGHT'&gt;"+ title;     
    
    this.onEnterFrame = function(){
    if (content_txt._alpha&lt;100){
        content_txt._alpha+=10;
        }
    }
    if(temp_i.length&lt;entries.length){
    temp_i.unshift(i);
    }
    else{
        temp_i.pop();
    } 

}

RefreshNews = function(news_xml){
content_txt.htmlText = “”;
news_xml.load(xml_file+"?"+new Date().getTime());
}