# Pop up window help

**URL:** <https://forum.kirupa.com/t/pop-up-window-help/27091>\
**Category:** flash\
**Created:** [July 30, 2003, 2:17am UTC](https://forum.kirupa.com/t/pop-up-window-help/27091 "2003-07-30T02:17:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RussianBeer](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/russianbeer/32/152_2.png) [@RussianBeer](https://forum.kirupa.com/u/RussianBeer)\
**Post date:** [July 30, 2003, 2:17am UTC](https://forum.kirupa.com/t/pop-up-window-help/27091/1 "2003-07-30T02:17:26Z")

</div>

I was following the tutorial to launch a centered pop up window…

I combined it with another movie i made. So basicaly in the Button the code is:

> on (release) {  
> //customize the window that gets opened  
> // 0 equals NO.  
> // 1 equals YES.  
> address = “[kirupa.com - Updates](http://www.kirupa.com/modular/pop-up.htm)”;  
> target\_winName = “kirupa”;  
> width = 400;  
> height = 300;  
> toolbar = 0;  
> location = 0;  
> directories = 0;  
> status = 0;  
> menubar = 0;  
> scrollbars = 1;  
> resizable = 0;  
> //sends data back to the function  
> openWinCentre(address, target\_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);  
> }

And then I created an other empty layer, and in that layer I put the code:

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

Okay now the proble, it launches a regular window instead of a popup window, and its also completle blank…

with this written in the URL bar(instead of adress):

javascript:var%20myWin;%20if(!myWin%20||%20myWin.closed){myWin%20=%20window.open(‘[http://www.kirupa.com/modular/pop-up.htm’,‘kirupa’,‘width=400,height=300,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,top=’+((screen.height/2)-(150))+‘,left=’+((screen.width/2)-(200))+'](http://www.kirupa.com/modular/pop-up.htm','kirupa','width=400,height=300,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,top='+((screen.height/2)-(150))+',left='+((screen.width/2)-(200))+')’)}else{myWin.focus();};void(0);

---

<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:** [July 30, 2003, 2:42am UTC](https://forum.kirupa.com/t/pop-up-window-help/27091/2 "2003-07-30T02:42:39Z")

</div>

Are you testing this in flash? If you are then it might not work, try exporting it out to html and test it there.

---

<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:** [July 30, 2003, 2:54am UTC](https://forum.kirupa.com/t/pop-up-window-help/27091/3 "2003-07-30T02:54:55Z")

</div>

Thanks… it works…  
:trout:

… I think I deserve that…
