# News Ticker

**URL:** <https://forum.kirupa.com/t/news-ticker/233874>\
**Category:** Uncategorized\
**Created:** [July 27, 2007, 5:15pm UTC](https://forum.kirupa.com/t/news-ticker/233874 "2007-07-27T17:15:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![m\_u\_r](https://avatars.discourse-cdn.com/v4/letter/m/85f322/32.png) [@m\_u\_r](https://forum.kirupa.com/u/m_u_r)\
**Post date:** [July 27, 2007, 5:15pm UTC](https://forum.kirupa.com/t/news-ticker/233874/1 "2007-07-27T17:15:12Z")

</div>

I have a news ticker on the top of every page on my site. The ticker works great when you open the page the first time, but when you click a link to a different page with the same ticker, it’s blank. Any ideas?

Thanks.

I’m using the code from the tutorial [http://www.kirupa.com/developer/mx2004/newsticker.htm](http://www.kirupa.com/developer/mx2004/newsticker.htm)

Here is the my code, which I am pretty sure is identical to that in the tutorial:

```auto
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://mywebsite.com/news.xml?blarg="+new Date().getTime());
//
function first_item() {
	delay = 1000;
	p = 0;
	display(p);
	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];
	newsMC.onRelease = function() {
		getURL(url[pos], "_blank");
	};
	newsMC.onRollOver = function() {
		this.newsText.setTextFormat(over);
	};
	newsMC.onRollOut = function() {
		this.newsText.setTextFormat(out);
	};
	timer();
}
function fadeout() {
	this.onEnterFrame = function() {
		if (newsMC.newsText._alpha>=0) {
			newsMC.newsText._alpha -= 5;
		} else {
			display(p);
			p++;
			delete this.onEnterFrame;
		}
	};
}

```
