My button script is as follows:
on (press) {
if (xmlNode + 1 == xmlNode.total) {
xmlNode = 0;
} else {
xmlNode += 1;
}
_root.xmlData.load("home.xml");
}
My Xml is as follows:
//Flash variables
//XML Interaction with Flash
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
//For loop
for (i=0; i<total; i++) { total = xmlNode.childNodes.length; }
client = xmlNode.firstChild.attributes.number;
company = xmlNode.childNodes*.childNodes[0].attributes.name;
photo = xmlNode.childNodes*.childNodes[0].attributes.photo;
swf = xmlNode.childNodes*.childNodes[0].attributes.swf;
involvement = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
description = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
url = xmlNode.childNodes*.childNodes[3].attributes.link;
//Output total of clients in XML
xmlTotal = xmlNode.childNodes.length;
/*External Flash Load AS*/
_root.createEmptyMovieClip("swfMC",1);
swfMC.loadMovie(swf);
swfMC._y = 10; //y position
swfMC._x = 0; //x position
/*External Image Load AS
_root.createEmptyMovieClip("image_mc",1);
image_mc.loadMovie(photo);*/
//Trace ('file loaded successfully');
note = "file loaded successfully";
} else {
//Trace ('error loading file');
note = "error loading file";
}
}
//XML Properties
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("home.xml");
stop();
But its not cycling through on click, can anyone spot the problem???