# Xml--\> buttons

**URL:** https://forum.kirupa.com/t/xml-buttons/180610
**Category:** Uncategorized
**Created:** [March 1, 2006, 10:23pm UTC](https://forum.kirupa.com/t/xml-buttons/180610 "2006-03-01T22:23:03Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![pbrollwitme](https://avatars.discourse-cdn.com/v4/letter/p/439d5e/32.png) [@pbrollwitme](https://forum.kirupa.com/u/pbrollwitme)
#### Post date: [March 1, 2006, 10:23pm UTC](https://forum.kirupa.com/t/xml-buttons/180610/1 "2006-03-01T22:23:03Z")

</div>

hey all,  
I have a list of text nodes generated from an xml file and loaded into flash. I want to be able to click the text and have it go to a URL specified in the xml file. This is what i have:

var thumb\_spacing = 35;  
listenerObject3 = new Object();  
listenerObject3.change = function() {  
value1 = categorycb.value;  
category\_xml = new XML();  
category\_xml.load(value1);  
category\_xml.ignoreWhite = true;  
category\_xml.onLoad = function() {  
var howMany:Array = new Array();  
howMany = this.firstChild.childNodes;  
if (howMany.length\>0) {  
for (var i:Number = 0; i\<howMany.length; i++) {  
var currentLink = howMany\*;  
var currentLink\_mc = textloader.createEmptyMovieClip(“links”+i, i);  
var currentLink\_mc2 = currentLink\_mc.createTextField(“my\_txt”+i, 3, 0, 0, 500, 30);  
currentLink\_mc.\_y = i\*thumb\_spacing;  
var my\_fmt:TextFormat = new TextFormat();  
currentLink\_mc2.multiline = true;  
currentLink\_mc2.wordWrap = true;  
currentLink\_mc2.color = 0xFF0000;  
currentLink\_mc2.selectable = true;  
currentLink\_mc2.html = true;  
link = currentLink.attributes.business;  
currentLink\_mc2.htmlText = currentLink.attributes.business+’ ‘+’-’+’ '+currentLink.attributes.short;  
currentLink\_mc2.setTextFormat(‘my\_fmt’);  
currentLink\_mc.onRelease = function(){  
getURL(link,"\_blank");  
}

}  
}  
};  
};  
\_root.categorycb.addEventListener(“change”, listenerObject3);

At first i thought it worked. However, on closer inspection, i realized that every line of text has the same link, which is the very last one passed to the flash from the xml file. I’ve worked on this for a while now with no luck. Any ideas??  
Thanks,  
Mat
