# Javascript:window.close help!

**URL:** <https://forum.kirupa.com/t/javascript-window-close-help/194571>\
**Category:** Uncategorized\
**Created:** [July 24, 2006, 5:55pm UTC](https://forum.kirupa.com/t/javascript-window-close-help/194571 "2006-07-24T17:55:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bradmitch03](https://avatars.discourse-cdn.com/v4/letter/b/5daacb/32.png) [@bradmitch03](https://forum.kirupa.com/u/bradmitch03)\
**Post date:** [July 24, 2006, 5:55pm UTC](https://forum.kirupa.com/t/javascript-window-close-help/194571/1 "2006-07-24T17:55:02Z")

</div>

_I used the javascript off of a tutorial on [Kirupa.com](http://Kirupa.com) to open a centered pop-up window, but need the java to close the other quicktimes once another is clicked to be opened.  
I could also have the multiple windows “quicktimes” open at once._

\*\*The script in my Flash button: \*\*

on (rollOver) {  
medical.gotoAndPlay(2);  
}  
on (rollOut) {  
medical.gotoAndPlay(13);  
}  
on (release) {  
//customize the window that gets opened  
// 0 equals NO.  
// 1 equals YES.  
address = “[http://www.post-op.com/web/investment.htm](http://www.post-op.com/web/investment.htm)”;  
target\_winName = “lial”;  
width = 340;  
height = 360;  
toolbar = 0;  
location = 0;  
directories = 0;  
status = 0;  
menubar = 0;  
scrollbars = 0;  
resizable = 0;  
//sends data back to the function  
openWinCentre(address, target\_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);  
}

\*\*  
The script in my HTML document:

\*\*\<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”\>  
\<html\>  
\<head\>  
\<title\>::: Post-Op :::\</title\>  
\<script language=“javascript” type=“text/javascript”\>  
function investement() {

/\* begin configuration _/  
var url = “investment.htm”;  
var w = “330”;  
var h = “420”;  
var menu = “no”;  
var scroll = “no”;  
var tool = “no”;  
var location = “no”;  
var resize = “no”;  
/_ end configuration \*/

var winl = (screen.width - w) / 2;  
var wint = (screen.height - h) / 2;  
winprops = ‘width=’+w+’, height=’+h+’, top=’+wint+’, left=’+winl+’, menubar=’+menu+’, scrollbars=’+scroll+’, toolbar=’+tool+’, location=’+location+’, resizable=’+resize+’’  
window.open(url, ‘investement’, winprops);  
window.open(‘acting.html’)  
}  
\</script\>  
\</head\>  
\<body bgcolor="#000000"\>  
\<div align=“center”\>  
\<p\>  
\<embed src=“[http://www.post-op.com/web/investement.mov](http://www.post-op.com/web/investement.mov)” width=“320” height=“256” align=“absmiddle”\>\</embed\>\</p\>  
\<p\> \<img src=“investment\_spacer.jpg” width=“300” height=“41” align=“right”\>  
\</p\>

\</body\>  
\</html\>  
\*From a little research I could find that I need a

getURL (“javascript:window.close(investment.htm);”);

but need to know where to put the java and if its needed for all the other window names when called.  
Thanks for your help.  
Brad\*
