# XML URL Link

**URL:** <https://forum.kirupa.com/t/xml-url-link/251700>\
**Category:** flash\
**Created:** [February 11, 2008, 9:53pm UTC](https://forum.kirupa.com/t/xml-url-link/251700 "2008-02-11T21:53:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mediumman](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mediumman/32/551_2.png) [@mediumman](https://forum.kirupa.com/u/mediumman)\
**Post date:** [February 11, 2008, 9:53pm UTC](https://forum.kirupa.com/t/xml-url-link/251700/1 "2008-02-11T21:53:25Z")

</div>

I am having problems linking out from my swf file…it is taking in the link information from the xml file…i have three buttons generated from the xml information and i have a goLink function setup but it always sends the user to the final link in the xml file…i want it to send the user to the appropriate xml link…the code is below, any help is appreciated.

var menu\_xml = new XML();  
menu\_xml.ignoreWhite = true;  
menu\_xml.onLoad = function(success){  
if (success) CreateMenu(this);  
}  
menu\_xml.load(“data.xml”);

function goLink(){  
getURL(goog,"\_blank");  
}

var item\_spacing = 25;  
var item\_count = 0;

function CreateMenu(my\_menu\_xml){

```
var items = my_menu_xml.firstChild.childNodes; 
for (var i=0; i&lt;items.length; i++) {
		var listing = items*.firstChild; 
		var linky = items*.childNodes[1];
		
		goog = linky.firstChild.nodeValue;
		
		var item_mc = _root.menu_mc.attachMovie("menu_itemer","item"+item_count, item_count);
		item_mc._y = item_count * item_spacing;
		
		item_count++;
		
		item_mc.link_text.text = listing.firstChild.nodeValue;
		
		item_mc.buttoner.onRelease = function() {
			goLink();
}
		
	}
}
```
