# Custom new window

**URL:** <https://forum.kirupa.com/t/custom-new-window/93175>\
**Category:** Uncategorized\
**Created:** [October 27, 2003, 1:42am UTC](https://forum.kirupa.com/t/custom-new-window/93175 "2003-10-27T01:42:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![adevejian](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@adevejian](https://forum.kirupa.com/u/adevejian)\
**Post date:** [October 27, 2003, 1:42am UTC](https://forum.kirupa.com/t/custom-new-window/93175/1 "2003-10-27T01:42:43Z")

</div>

I’m using the Kirupa tutorial script on how to create a customized, centered window. It works for the first button i click on my site, but then, when i try to click another button to popup a window it doesn’t work.

Here’s the actionscript for each button:  
on (release) {  
address = “Popup.asp”;  
target\_winName = “Popup”;  
width = 405;  
height = 340;  
toolbar = 0;  
location = 0;  
directories = 0;  
status = 0;  
menubar = 0;  
scrollbars = 0;  
resizable = 0;  
openWinCenter(address, target\_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);  
}

Here’s the other actionscript not on the button:  
Movieclip.prototype.openWinCenter = 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);”);  
}
