# Variables & address

**URL:** <https://forum.kirupa.com/t/variables-address/28523>\
**Category:** Uncategorized\
**Created:** [August 14, 2003, 5:22pm UTC](https://forum.kirupa.com/t/variables-address/28523 "2003-08-14T17:22:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zephn](https://avatars.discourse-cdn.com/v4/letter/z/5f8ce5/32.png) [@zephn](https://forum.kirupa.com/u/zephn)\
**Post date:** [August 14, 2003, 5:22pm UTC](https://forum.kirupa.com/t/variables-address/28523/1 "2003-08-14T17:22:31Z")

</div>

Attached is the file with the code applied. I’m trying to get each menu item to open a new window with the website listed in sitelist. Can anyone tell me why it keeps opening a blank page that says “about blank” in the title bar and the address bar?  
Thanks  
[AS]Movieclip.prototype.openWinCentre = function(url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable) {  
getURL(“javascript:var myWin; if(!myWin || myWin.closed){myWin = window.open(’”+url+"’,’"+winName+"’,’"+“width=”+w+",height="+h+",toolbar="+toolbar+",location="+location+",directories="+directories+",status="+status+",menubar="+menubar+",scrollbars="+scrollbars+",resizable="+resizable+",top=’+((screen.height/2)-("+h/2+"))+’,left=’+((screen.width/2)-("+w/2+"))+’"+"’)}else{myWin.focus();};void(0);");  
};

var menuItems = [  
“Wizard of the Coast”,  
“Realms Quest LARP”,  
“Midland LARP”,  
“Adventure Seekers”,  
“Zephn Photography”,  
“Taco Bell”];

var siteList = [“[http://www.wizards.com](http://www.wizards.com)”,  
“[http://www.realmsquest.org](http://www.realmsquest.org)”,  
“[http://www.adventuresinmmidland.org](http://www.adventuresinmmidland.org)”,  
“[http://www.adventureseekersofdoom.20m.com](http://www.adventureseekersofdoom.20m.com)”,  
“[http://www.zephn.com](http://www.zephn.com)”,  
“[http://www.tacobell.com](http://www.tacobell.com)”];

for (i=0; i\<menuItems.length; i++) {  
mc = container.dynamicButton.duplicateMovieClip(“button”+i, i);  
mc.menuLabel.text = menuItems\*;  
mc.\_y = i\*(mc.\_height-1);  
mc.siteToLoad = siteList\*;  
mc.actualButton.onPress = function() {  
address = siteToLoad;  
target\_winName = “TRPA”;  
width = 780;  
height = 640;  
toolbar = 1;  
location = 1;  
directories = 1;  
status = 1;  
menubar = 1;  
scrollbars = 1;  
resizable = 1;  
//sends data back to the function  
openWinCentre(address, target\_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);

};  
}[/AS]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 14, 2003, 9:43pm UTC](https://forum.kirupa.com/t/variables-address/28523/2 "2003-08-14T21:43:41Z")

</div>

[AS]for (i=0; i\<menuItems.length; i++) {  
var mc = container.dynamicButton.duplicateMovieClip(“button”+i, i);  
mc.menuLabel.text = menuItems\*;  
mc.\_y = i\*(mc.\_height-1);  
mc.siteToLoad = siteList\*;  
mc.actualButton.onPress = function() {  
openWinCentre(this.\_parent.siteToLoad, “TRPA”, 780, 640, 1, 1, 1, 1, 1, 1, 1);  
};  
}[/AS]  
And please use **[AS][/AS]** tags. :sleep:  
[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=31380](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=31380)
