# getURL with XML \[help!\]

**URL:** https://forum.kirupa.com/t/geturl-with-xml-help/309434
**Category:** flash
**Created:** [May 14, 2010, 7:38pm UTC](https://forum.kirupa.com/t/geturl-with-xml-help/309434 "2010-05-14T19:38:48Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Kurtz](https://avatars.discourse-cdn.com/v4/letter/k/97f17d/32.png) [@Kurtz](https://forum.kirupa.com/u/Kurtz)
#### Post date: [May 14, 2010, 7:38pm UTC](https://forum.kirupa.com/t/geturl-with-xml-help/309434/1 "2010-05-14T19:38:48Z")

</div>

Hi All,

I’ve got the following code, that works fine with just one button, but I can’t find the way to fix it to work with three buttons:

**XML** :

* * *

\<links\>  
\<link\>[http://www.dynamicdrive.com](http://www.dynamicdrive.com)\</link\>  
\<link\>[http://www.google.com](http://www.google.com)\</link\>  
\<link\>[http://www.apple.com](http://www.apple.com)\</link\>  
\</links\>

* * *

**AS** :

* * *

var xml:XML = new XML()  
xml.ignoreWhite = true;

xml.onLoad = function() {  
loadLinks();  
}

function loadLinks() {  
var link:String = xml.firstChild.childNodes[0].childNodes[0]  
btn\_1.onRelease = function() {  
getURL(link);  
}  
}

xml.load(“links.xml”);

* * *

Do you know how to fix this to make it work with “btn\_2” and “btn\_3” instances?

Thanks for your help!
