# Pop-up with different addy

**URL:** <https://forum.kirupa.com/t/pop-up-with-different-addy/18694>\
**Category:** Uncategorized\
**Created:** [April 19, 2003, 8:49pm UTC](https://forum.kirupa.com/t/pop-up-with-different-addy/18694 "2003-04-19T20:49:27Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![apostrophe](https://avatars.discourse-cdn.com/v4/letter/a/e8c25b/32.png) [@apostrophe](https://forum.kirupa.com/u/apostrophe)\
**Post date:** [April 19, 2003, 8:49pm UTC](https://forum.kirupa.com/t/pop-up-with-different-addy/18694/1 "2003-04-19T20:49:27Z")

</div>

I’m using the centered pop-up tutorial on this site, it works just fine. The problem is that if that pop-up is already open and I try to open another pop-up with the same script, but a different address, nothing happens. You have to close the first pop-up to get another one to launch.

FYI: I have a static layer with all of my menu buttons, this layer covers the entire movie. Some of the buttons change the frames in the movie and some open pop-ups.

I have the prototype script loaded into a blank frame on another layer that also covers the entire movie.

Does this make sense?

How do I open two pop-ups with this script, without the user having to close the first?

Thanks,  
'pos

---

<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:** [April 19, 2003, 9:34pm UTC](https://forum.kirupa.com/t/pop-up-with-different-addy/18694/2 "2003-04-19T21:34:44Z")

</div>

I can’t explain it too well because I don’t know too much about javascripting, but I do know that you can’t open multiple windows with that popup tut because everything will point to that window (I think it’s called ‘myWin’). In the beginning of the javascript it asks if ‘myWin’ is closed.

---

<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:** [April 19, 2003, 9:50pm UTC](https://forum.kirupa.com/t/pop-up-with-different-addy/18694/3 "2003-04-19T21:50:43Z")

</div>

Thank you. Seems to make sense. Hopefully some wise soul will pop in with a solution.

Cheers,

'pos

---

<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:** [April 19, 2003, 10:10pm UTC](https://forum.kirupa.com/t/pop-up-with-different-addy/18694/4 "2003-04-19T22:10:25Z")

</div>

yeah… you can modify the script a bit and it should open any number of popups.

```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:** [April 19, 2003, 10:14pm UTC](https://forum.kirupa.com/t/pop-up-with-different-addy/18694/5 "2003-04-19T22:14:11Z")

</div>

Kax,

Thank you. It works perfectly.

'pos

---

<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:** [April 19, 2003, 10:18pm UTC](https://forum.kirupa.com/t/pop-up-with-different-addy/18694/6 "2003-04-19T22:18:31Z")

</div>

no problem. 😉 =)

---

<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 2, 2003, 7:11pm UTC](https://forum.kirupa.com/t/pop-up-with-different-addy/18694/7 "2003-07-02T19:11:34Z")

</div>

That code, wont work 4 me, Flash keeps telling me that i hav a syntax problem

---

<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 3, 2003, 4:35am UTC](https://forum.kirupa.com/t/pop-up-with-different-addy/18694/8 "2003-07-03T04:35:26Z")

</div>

hmmm…testing!

---

<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 3, 2003, 4:37am UTC](https://forum.kirupa.com/t/pop-up-with-different-addy/18694/9 "2003-07-03T04:37:12Z")

</div>

Kax code should work

---

<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 3, 2003, 4:39am UTC](https://forum.kirupa.com/t/pop-up-with-different-addy/18694/10 "2003-07-03T04:39:10Z")

</div>

> _Originally posted by samoscratch_  
> **hmmm…testing!**

… testing what!? 😛

---

<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 3, 2003, 4:53am UTC](https://forum.kirupa.com/t/pop-up-with-different-addy/18694/11 "2003-07-03T04:53:12Z")

</div>

sorry…my avatar and pictures…

---

<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 3, 2003, 8:58am UTC](https://forum.kirupa.com/t/pop-up-with-different-addy/18694/12 "2003-07-03T08:58:13Z")

</div>

how to make the code work?sorry,hope you bear with me on this one, i’m a newbie…

---

<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 3, 2003, 4:02pm UTC](https://forum.kirupa.com/t/pop-up-with-different-addy/18694/13 "2003-07-03T16:02:28Z")

</div>

[http://www.kirupa.com/developer/mx/centered\_popup.htm](http://www.kirupa.com/developer/mx/centered_popup.htm)

all you have to do is replace the code provided in the tutorial with the code i posted.

---

<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 3, 2003, 4:40pm UTC](https://forum.kirupa.com/t/pop-up-with-different-addy/18694/14 "2003-07-03T16:40:39Z")

</div>

kax, i replaced my code wit urz with a few personalisations, here it is

```auto
on (release) {
	openWinCentre = function(url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable) {
    getURL("javascript:window.open('"razzandbiggy.html"',"razzandbiggy" ),
	width=544;
	height=394;
	toolbar=0;
	location=0;
	directories=0;
	status=0;
	menubar=0;
	scrollbars=0;
	resizable=0;
	top='+((screen.height/2)-("+h/2+"))+';
	left='+((screen.width/2)-("+w/2+"))+'"+"');void(0);");
}; 

```

im still gettin an error message

---

<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 3, 2003, 5:30pm UTC](https://forum.kirupa.com/t/pop-up-with-different-addy/18694/15 "2003-07-03T17:30:10Z")

</div>

yeah… i’m still waiting for your FLA. 😛

you’re supposed to replace the code in the frame actions, not the code in the Button.

that is, instead of this code:

```auto
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);");
}

```

you use this one:

```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 3, 2003, 5:54pm UTC](https://forum.kirupa.com/t/pop-up-with-different-addy/18694/16 "2003-07-03T17:54:28Z")

</div>

o thnx its definitely better than what I had b4 but it still doesnt work perfect cuz instead of getting a completely new pop up each time i click something in my menu, it just refreshes the old one wit the new page. ☹

---

<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 4, 2003, 5:12am UTC](https://forum.kirupa.com/t/pop-up-with-different-addy/18694/17 "2003-07-04T05:12:38Z")

</div>

are you using the same name for all the popup windows (the winName parameter)??

that’s the only reason i can think of.
