# Changing dynamic text color through a loop

**URL:** <https://forum.kirupa.com/t/changing-dynamic-text-color-through-a-loop/199738>\
**Category:** Uncategorized\
**Created:** [September 5, 2006, 4:18pm UTC](https://forum.kirupa.com/t/changing-dynamic-text-color-through-a-loop/199738 "2006-09-05T16:18:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![soupee](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@soupee](https://forum.kirupa.com/u/soupee)\
**Post date:** [September 5, 2006, 4:18pm UTC](https://forum.kirupa.com/t/changing-dynamic-text-color-through-a-loop/199738/1 "2006-09-05T16:18:12Z")

</div>

//-----------------------  
function loadXML(loaded) {  
if (loaded) {  
xmlNode = this.firstChild;  
showdate = [];  
showtime = [];  
showlength = [];  
showtitle = [];  
showurl = [];  
episodetitle = [];  
episodeurl = [];  
total = xmlNode.childNodes.length;  
for (i=0; i\<total; i++) {  
showdate\* = xmlNode.childNodes\*.childNodes[0].firstChild.nodeValue;  
showtime\* = xmlNode.childNodes\*.childNodes[1].firstChild.nodeValue;  
showlength\* = xmlNode.childNodes\*.childNodes[2].firstChild.nodeValue;  
showtitle\* = xmlNode.childNodes\*.childNodes[3].firstChild.nodeValue;  
showurl\* = xmlNode.childNodes\*.childNodes[4].firstChild.nodeValue;  
episodetitle\* = xmlNode.childNodes\*.childNodes[5].firstChild.nodeValue;  
episodeurl\* = xmlNode.childNodes\*.childNodes[6].firstChild.nodeValue;

}  
mainSchedule();  
} else {  
content = “file not loaded!”;  
}  
}

bgdbuttons = Array()  
bgds = new Array();  
bgds.push()

xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;  
xmlData.load(“info.xml”);

function mainSchedule() {  
if (loaded == filesize) {  
for (var i=0; i\<total; i++) {  
this[“show” + i].mc\_time.text = showtime\*;  
this[“show” + i].mc\_show.text = showtitle\*;  
this[“show” + i].mc\_episode.text = “Episode:”;  
this[“show” + i].mc\_episodename.text = episodetitle\*;  
this[“show” + i].mcClick1.index=i;  
this[“show” + i].mcClick2.index=i;  
this[“show” + i].mcClick1.onRelease = function() {  
getURL(\_root.showurl[this.index]);  
}  
this[“show” + i].mcClick1.onRollOver = function() {  
\_root.show[this.index].mc\_show.color = 0x000000;

```
		}
		
		this["show" + i].mcClick2.onRelease = function() {
			getURL(_root.episodeurl[this.index]);
		}
	}
}

```

}
