# Popup same window problem

**URL:** <https://forum.kirupa.com/t/popup-same-window-problem/32083>\
**Category:** Uncategorized\
**Created:** [October 1, 2003, 11:05am UTC](https://forum.kirupa.com/t/popup-same-window-problem/32083 "2003-10-01T11:05:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rgart](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@rgart](https://forum.kirupa.com/u/rgart)\
**Post date:** [October 1, 2003, 11:05am UTC](https://forum.kirupa.com/t/popup-same-window-problem/32083/1 "2003-10-01T11:05:14Z")

</div>

hello  
In my swf i’ve created several buttons that each open a popup  
now here lies my problem can i when i change buttons automaticaly close the visible popup. I’ve tried to load them in same popup by giving the same target\_winName to the popup this works fine but for one problem my popup is now found at the bottom of the browser window minimized is there a way to keep the popup in place so i can load my different pages into it without each time going down the browser to open the window or is there a way when you click on a button that it automatically closes the previous popup window.  
This is the script i got from kirupa  
on (release) {  
// customize the window that gets opened  
// 0 equals NO.  
// 1 equals YES.  
address = “boetti.htm”;  
target\_winName = “Boetti”;  
width = 650;  
height = 700;  
toolbar = 0;  
location = 0;  
directories = 0;  
status = 0;  
menubar = 0;  
scrollbars = 1;  
resizable = 1;  
// sends data back to the function  
openWinCentre(address, target\_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);  
}  
and this in the first frame

\_global.openWinCentre = function(url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable) {  
getURL(“javascript: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+"))+’"+"’);void(0);");  
stop();  
};

hope someone can help  
thank you
