# getURL - undefined prob

**URL:** <https://forum.kirupa.com/t/geturl-undefined-prob/160476>\
**Category:** flash\
**Created:** [August 26, 2005, 6:02am UTC](https://forum.kirupa.com/t/geturl-undefined-prob/160476 "2005-08-26T06:02:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bulletz](https://avatars.discourse-cdn.com/v4/letter/b/f6c823/32.png) [@bulletz](https://forum.kirupa.com/u/bulletz)\
**Post date:** [August 26, 2005, 6:02am UTC](https://forum.kirupa.com/t/geturl-undefined-prob/160476/1 "2005-08-26T06:02:58Z")

</div>

hello:  
i have a problem with getURL in a dynamically generated menu, when i clicked the button it shows undefined in the browser. but when i trace it, it shows the proper URL. check the code below. thanks in advance.

heirarchy:  
content\_mc -\> bg\_mc -\> nav\_btn

script:  
var buttonNames:Array = [“name1”,“name2”,“name3”];  
var btnURL:Array = [“URL1”,“URL2”,“URL3”];  
var spacing:Number = content\_mc.bg\_mc.\_height + 1;  
content\_mc.bg\_mc.\_visible = false;  
var numberofButtons:Number = buttonNames.length;  
var i:Number = -1;

while (++i \< numberofButtons) {  
var name:String = “item” + i;  
content\_mc.bg\_mc.duplicateMovieClip(name, i);  
content\_mc[name].name\_txt.text = buttonNames\*;  
content\_mc[name].\_x = 0;  
content\_mc[name].\_y = i \* spacing;  
//trace(buttonNames\*);  
trace (btnURL\*);  
content\_mc[name].nav\_btn.onRelease = function () {  
getURL (btnURL\*,"");  
};  
}
