Hi
I’m very new to this so I’ve most definitely made a mistake somewhere but not sure what I’ve done wrong. I have adapted a new ticker so that it displays more rows but the rows that have no data display as undefined rather than blank.
Here is my code.
function loadXML(loaded) {
if(loaded) {
xmlNode = this.firstChild;
date = [];
act1 = [];
act2 = [];
act3 = [];
act4 = [];
total = xmlNode.childNodes.length;
for(i=0;i<total;i++) {
date* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
act1* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
act2* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
act3* = xmlNode.childNodes*.childNodes[3].firstChild.nodeValue;
act4* = xmlNode.childNodes*.childNodes[4].firstChild.nodeValue;
}
first_item();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("gigs.xml");
function first_item() {
delay = 3000;
p = 0;
display(p);
p++;
}
function timer() {
myInterval = setInterval(ticker,delay);
function ticker() {
clearInterval(myInterval);
if(p == total) {
p = 0;
}
fadeout();
}
}
function display(pos) {
newsMC.newsText._alpha = 100;
newsMC.newsText.text = date[pos];
act1MC.actText.text = act1[pos];
act2MC.actText.text = act2[pos];
act3MC.actText.text = act3[pos];
act4MC.actText.text = act4[pos];
timer();
}
function fadeout() {
this.onEnterFrame = function() {
display(p);
p++;
delete this.onEnterFrame;
}
}
Any help would be greatly appreciated.