# How to get variabel to function

**URL:** <https://forum.kirupa.com/t/how-to-get-variabel-to-function/143411>\
**Category:** Uncategorized\
**Created:** [April 5, 2005, 7:09pm UTC](https://forum.kirupa.com/t/how-to-get-variabel-to-function/143411 "2005-04-05T19:09:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![philipip](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/philipip/32/1231_2.png) [@philipip](https://forum.kirupa.com/u/philipip)\
**Post date:** [April 5, 2005, 7:09pm UTC](https://forum.kirupa.com/t/how-to-get-variabel-to-function/143411/1 "2005-04-05T19:09:18Z")

</div>

Hi!  
Im building a flash menu who get its content from a xml fil. In my  
final steps i got this problem with adding the [color=SandyBrown][color=Black]picHref[/color] [/color]variable to my  
button.

Is it enyone out there who knows how i could do this?  
[indent]function loadNodes (menu\_xml) {

```
    var node = menu_xml.firstChild.childNodes;

    for (i=0; i &lt; node.length; i++) {
        
        var picTxt = node*.attributes.picTxt;
        var picUrl = node*.attributes.picUrl;
        [color=SandyBrown]var picHref = node*.attributes.picHref;[/color]
        
        //trace (i);
        //trace (picTxt);
        //trace (picUrl);
        //trace (picHref);
        
        var menu = this.attachMovie ('holder', 'holder'+i, i);
            menu.btn_txt.text = picTxt;
            menu.mask.picture.loadMovie (picUrl);
            menu._x = i * (menu._width + 1);        
            
          [color=SandyBrown] menu.btn_mc.onRelease = function () {
                
                getURL (this.picHref, '_self');
                [color=Black]trace (this.picHref);[/color]
                
            }[/color]
    }
    
}

```

var menu\_xml = new XML ();  
menu\_xml.ignoreWhite = true;  
menu\_xml.onLoad = function (success) {

```
    if (success) {
                    
        loadNodes (this);
        
    } else {
        
        trace ('hmmm.. can^t find xml');
    
    }

}
menu_xml.load('menu_xml.xml');

```

ps!! sorry for my short description. but my english is extremley bad…

tanx.

Philip  
[/indent]
