Hello all,
I’m working on a banner ad that pulls in XML displaying festivals. I can pull in the name (festnames), location (locations) and date (dates) fine, but the url links (btns) don’t work. I need to have each listing of the festivals click thru to the designated url for that festival. Here’s an example of my XML below…
<xml>
<festival>
<fest festnames ="Blab1" locations ="Place1" dates ="Date1" btns="URL1"></fest>
<fest festnames ="Blab2" locations ="Place2" dates ="Date2" btns="URL2"></fest>
<fest festnames ="Blab3" locations ="Place3" dates ="Date3" btns="URL3"></fest>
<fest festnames ="Blab4" locations ="Place4" dates ="Date4" btns="URL4"></fest>
<fest festnames ="Blab5" locations ="Place5" dates ="Date5" btns="URL5"></fest>
</festival>
</xml>
What seems to keep happening is that all the buttons link to whatever the last url link (btns) is, which in the example above, is URL5. Here is an example of the AS that I’m using to pull in the btns attribute from my XML.
_parent.mList.fests = festXML.firstChild.firstChild.childNodes;
function populateBtns () {
var k:Number;
_parent.mList.btnList = new Array ();
for (k = 0; k < fests.length; k++) {
btnList[k] = new Object ();
btnList[k].btns = fests[k].attributes.btns;
attachMovie ("mInvisible", "mInvisible" + k, (k + 2) * 13);
myBtns = this.getInstanceAtDepth ( (k + 2) * 13);
urlLink = btnList[k].btns;
myBtns.onRelease = function () {
getURL (urlLink, "_blank");
}
}
}
Where am I going wrong??? I’ve been at this for many hours, looked through many of the XML tutorials, but haven’t found anything that is helping. Please help if you can. Thanks!