hej peeps …
after reading the tuts here on kirupa and as.org i started
fiddling around myself with this xml-shiznit …
i used LostinBeta’s/Senocular’s xmlmenu.zip as reference …
i created 3 buttons that will link to 3 different sites
the buttons get their info from xml file …
when i run my file the buttons appear, each with the
correct <ITEM NAME/> only they all link to the same site …
(the last “<ITEM URL/>” entry in the xml file)
how come … ??
i doubledouble checked the whole thingie ,searched the forums,
read the tuts again … but i can’t figure out why they all link to the same site …
here’s my xml :
<?xml version="1.0"?>
<LINKS>
<ITEM NAME="check this site" URL="http://www.google.nl/" TARGET="_blank" />
<ITEM NAME="kirupa.com" URL="http://www.kirupa.com/" TARGET="_blank" />
<ITEM NAME="actionscript.org" URL="http://www.actionscript.org/" TARGET="_blank" />
</LINKS>
and here’s the actionscript i use
myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function (success) {
myITEM = this.firstChild.childNodes;
if (success) {
for (i=0; i<myITEM.length; i++) {
myATTRIBUTES = myITEM*.attributes;
myButton = _root.attachMovie("textClip", "textClip"+i, i);
myButton._x = myButton._y = 100;
myButton._y += 40*i;
myButton.buttonLabel.autoSize = true;
myButton.buttonLabel.text = myATTRIBUTES.NAME;
myURL = myATTRIBUTES.URL;
myTARGET = myATTRIBUTES.TARGET;
myButton.onRelease = function () {
getURL(myURL, myTARGET);
}
}
}
}
myXML.load("links.xml");