I am creating an automated schedule. I can’t seem to assign the correct showurl to the onRelease function. It shows up as undefined. And if i put it as a variable, it only remembers the last url in the array.
Basically, i have it generating and naming 6-7 movieclips depending on the xml file and i want to assign their respective URL when a user clicks thru.
Can someone help me, please?
//-----------------------
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!”;
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load(“schedule.xml”);
function mainSchedule() {
if (loaded == filesize) {
for (var i=0; i<total; i++) {
_root[“show” + i].mc_time.text = showtime*;
_root[“show” + i].mc_show.text = showtitle*;
_root[“show” + i].mc_episode.text = “Episode:”;
_root[“show” + i].mc_episodename.text = episodetitle*;
_root[“show” + i].mcClick1.onRelease = function() {
getURL(episodetitle*);
}
}
}
}
stop;