# Problem wit pop up

**URL:** <https://forum.kirupa.com/t/problem-wit-pop-up/25609>\
**Category:** flash\
**Created:** [July 14, 2003, 11:56pm UTC](https://forum.kirupa.com/t/problem-wit-pop-up/25609 "2003-07-14T23:56:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![worm](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/worm/32/235_2.png) [@worm](https://forum.kirupa.com/u/worm)\
**Post date:** [July 14, 2003, 11:56pm UTC](https://forum.kirupa.com/t/problem-wit-pop-up/25609/1 "2003-07-14T23:56:04Z")

</div>

i know that this has been answered in here somewhere b4 but i cant find it and i need to know.

I have a menu in my movie with different buttons that u click, each of which spawn a pop up window. My problem is this, everytime a pop up opens, i must close it before i can open another.

Heres the code i use.

This is on an actions frame in the main movie

[AS]  
Movieclip.prototype.openWinCentre = function(url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable)  
{  
getURL(“java script: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);");  
};  
[/AS]

And this is on the buttons

[AS]  
on (release) {  
// customize the window that gets opened  
// 0 equals NO.  
// 1 equals YES.  
address = “slbdeadbeat.html”;  
target\_winName = “slb”;  
width = 544;  
height = 394;  
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);  
}  
[/AS]

just so u know, each button has a different name

thanks in advance

---

<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 15, 2003, 9:17pm UTC](https://forum.kirupa.com/t/problem-wit-pop-up/25609/2 "2003-07-15T21:17:56Z")

</div>

not sure, but i think the problem is with the first code on the actions layer. I dont know any js so im pretty much stuck

---

<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 15, 2003, 9:44pm UTC](https://forum.kirupa.com/t/problem-wit-pop-up/25609/3 "2003-07-15T21:44:22Z")

</div>

```auto
MovieClip.prototype.openWinCentre = function(url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable) {
        getURL("java **** script: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);");
};

```

---

<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 15, 2003, 9:51pm UTC](https://forum.kirupa.com/t/problem-wit-pop-up/25609/4 "2003-07-15T21:51:54Z")

</div>

yep, thats the one

---

<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 16, 2003, 3:32pm UTC](https://forum.kirupa.com/t/problem-wit-pop-up/25609/5 "2003-07-16T15:32:29Z")

</div>

someone suggested that the problem was with this part of the first script (the last part)

```auto
myWin.focus();
};
void(0);
};

```
