Hi,
i am trying to build a xml menu. my xml scheme looks like this:
<images>
<pic>
<cat></cat>
<image></image>
<titlename></titlename>
<description></description>
</pic>
</images>
i am trying to use cat to sort the menu into columns. for example if cat == web _x = 300.
heres my code
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
cat = [];
image = [];
titlename = [];
description = [];
/*bodytext = [];*/
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
cat* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
image* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
titlename* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
description* = xmlNode.childNodes*.childNodes[3].firstChild.nodeValue;
trace(cat*);
main_menu.pbtn.duplicateMovieClip("pbtn"+i, i);
}
for (var i = 0; i<image.length; i++) {
item = _root.attachMovie("itemClip", "itemClip"+i, i);
item._x = 0;
item._y = 20*i;
item.itemLabel.text = titlename*;
item.myUrl = image*;
item.onRelease = function() {
getURL(this.myUrl, "_blank");
};
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
many thanks,
G