# Opening sized popups with Flash/Javascript

**URL:** https://forum.kirupa.com/t/opening-sized-popups-with-flash-javascript/246673
**Category:** web dev
**Created:** [December 13, 2007, 10:23am UTC](https://forum.kirupa.com/t/opening-sized-popups-with-flash-javascript/246673 "2007-12-13T10:23:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Plasmic\_Steve](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/plasmic_steve/32/361_2.png) [@Plasmic\_Steve](https://forum.kirupa.com/u/Plasmic_Steve)
#### Post date: [December 13, 2007, 10:23am UTC](https://forum.kirupa.com/t/opening-sized-popups-with-flash-javascript/246673/1 "2007-12-13T10:23:45Z")

</div>

I know this is an easy one, but I can’t figure it out. I’m trying to open two sized popup windows from a Flash file, using this code in the main timeline:

\_root.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);”);  
}

and this code in the individual buttons (windowName is given a value in the level above the button, which I’ve traced and is coming through):

on (release) {  
address = linkname;  
target\_winName = windowName;  
width = 800;  
height = 700;  
toolbar = 0;  
location = 0;  
directories = 0;  
status = 0;  
menubar = 0;  
scrollbars = 1;  
resizable = 0;

```
//sends data back to the function 
_root.openWinCentre(address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);

```

}

The problem: once a window is opened, the other cannot be opened from the Flash file without first closing the opened popup.

Does anyone have an idea on what the issue is? Or a better/different code for popups?

Help is appreciated - thanks,

Steve
