# Need help to figure out a loop

**URL:** <https://forum.kirupa.com/t/need-help-to-figure-out-a-loop/200515>\
**Category:** Uncategorized\
**Created:** [September 12, 2006, 9:09pm UTC](https://forum.kirupa.com/t/need-help-to-figure-out-a-loop/200515 "2006-09-12T21:09:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lojack](https://avatars.discourse-cdn.com/v4/letter/l/8edcca/32.png) [@lojack](https://forum.kirupa.com/u/lojack)\
**Post date:** [September 12, 2006, 9:09pm UTC](https://forum.kirupa.com/t/need-help-to-figure-out-a-loop/200515/1 "2006-09-12T21:09:36Z")

</div>

hey

this is the code to a news ticker file that i am working on. the problem is that i need the flash file to refresh the xml after the file is read. not sure how to do that.

function loadXML(loaded) {  
if (loaded) {  
xmlNode = this.firstChild;  
caption = [];  
url = [];  
total = xmlNode.childNodes.length;  
for (i=0; i\<total; i++) {  
caption\* = xmlNode.childNodes\*.childNodes[0].firstChild.nodeValue;  
url\* = xmlNode.childNodes\*.childNodes[1].firstChild.nodeValue;  
}  
first\_item();  
} else {  
content = “file not loaded!”;  
}  
}  
xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;  
xmlData.load(“[http://news.xml](http://www.tallahassee.com/legacy/special/election/news.xml)”);  
//  
function first\_item() {  
delay = 4000;  
p = 0;  
display§;  
p++;  
}  
function timer() {  
myInterval = setInterval(ticker, delay);  
function ticker() {  
clearInterval(myInterval);  
if (p == total) {  
p = 0;  
}  
fadeout();  
}  
}  
function display(pos) {  
over = new TextFormat();  
over.underline = true;  
//  
out = new TextFormat();  
out.underline = false;  
//  
newsMC.newsText.\_alpha = 100;  
newsMC.newsText.text = caption[pos];  
timer();  
}  
function fadeout() {  
this.onEnterFrame = function() {  
if (newsMC.newsText.\_alpha\>=0) {  
newsMC.newsText.\_alpha -= 5;  
} else {  
display§;  
p++;  
delete this.onEnterFrame;  
}  
};  
}

all help is appreciated.

thanks

lojack
