# getURL from xml array

**URL:** https://forum.kirupa.com/t/geturl-from-xml-array/240791
**Category:** flash
**Created:** [October 6, 2007, 5:36am UTC](https://forum.kirupa.com/t/geturl-from-xml-array/240791 "2007-10-06T05:36:06Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jiajin](https://avatars.discourse-cdn.com/v4/letter/j/c4cdca/32.png) [@jiajin](https://forum.kirupa.com/u/jiajin)
#### Post date: [October 6, 2007, 5:36am UTC](https://forum.kirupa.com/t/geturl-from-xml-array/240791/1 "2007-10-06T05:36:06Z")

</div>

i am still learning actionscript and i am tryin to make a dynamic xml menu. i have stored the url links in the xml file, but i cannot get the getURL function to work. can anyone give some advice. thanks!

```auto
var menuXML:XML = new XML();
menuXML.ignoreWhite = true;
menuXML.onLoad = loadXML;

function loadXML(success) {

    spacing = 120;
    if (success) {
        xmlNode = this.firstChild;
        menu = [];
        url = [];
        total = xmlNode.childNodes.length;

     

        for (i=0; i<total; i++) {
            menu* = xmlNode.childNodes*.attributes.title;
            url* = xmlNode.childNodes*.attributes.url;

            newBut = menuHolder.attachMovie("button", "but"+i, i);

            newBut._x = (i*spacing);

            newBut.menu_txt.text = menu*;

            _parent["but"+i].onRelease = function() {
                getURL(url*);
            };
        }

    }
}

menuXML.load("menu.xml");

```

```auto
<?xml version="1.0" encoding="utf-8" standalone="yes"?>

<buttonmenu>
    
    <menu title = "HOME" url = "http://www.home.net"></menu>
    
    <menu title = "ABOUT" url = "http://www.google.com"></menu>
    
    <menu title = "CONTACT" url = "http://www.cnn.com"></menu>
    
    <menu title = "NEWS" url = "http://www.abc.com"></menu>
    
    <menu title = "HISTORY" url = "http://www.123.com"></menu>
    
    <menu title = "EXTRAS" url = "http://www.xyz.com"></menu>
    
</buttonmenu>

```
