# Custom new window

**URL:** <https://forum.kirupa.com/t/custom-new-window/34024>\
**Category:** flash\
**Created:** [October 27, 2003, 1:42am UTC](https://forum.kirupa.com/t/custom-new-window/34024 "2003-10-27T01:42:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![adevejian](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@adevejian](https://forum.kirupa.com/u/adevejian)\
**Post date:** [October 27, 2003, 1:42am UTC](https://forum.kirupa.com/t/custom-new-window/34024/1 "2003-10-27T01:42:43Z")

</div>

I’m using the Kirupa tutorial script on how to create a customized, centered window. It works for the first button i click on my site, but then, when i try to click another button to popup a window it doesn’t work.

Here’s the actionscript for each button:  
on (release) {  
address = “Popup.asp”;  
target\_winName = “Popup”;  
width = 405;  
height = 340;  
toolbar = 0;  
location = 0;  
directories = 0;  
status = 0;  
menubar = 0;  
scrollbars = 0;  
resizable = 0;  
openWinCenter(address, target\_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);  
}

Here’s the other actionscript not on the button:  
Movieclip.prototype.openWinCenter = 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);”);  
}

---

<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:** [October 27, 2003, 4:14am UTC](https://forum.kirupa.com/t/custom-new-window/34024/2 "2003-10-27T04:14:13Z")

</div>

It doesnt pop up a new window or it doesnt pop up the correct link?

What information are you changing from a/s to a/s for each button?

~ Seretha :love:

---

<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:** [October 27, 2003, 4:16am UTC](https://forum.kirupa.com/t/custom-new-window/34024/3 "2003-10-27T04:16:34Z")

</div>

I see you are using the old code, the tutorial has been updated since then, and it now works for multiple windows.

---

<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:** [October 27, 2003, 5:15am UTC](https://forum.kirupa.com/t/custom-new-window/34024/4 "2003-10-27T05:15:25Z")

</div>

here’s the url i’ve got:

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

is this the newest version?

---

<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:** [October 27, 2003, 5:25am UTC](https://forum.kirupa.com/t/custom-new-window/34024/5 "2003-10-27T05:25:37Z")

</div>

Yep, if you notice, the function to create the window changed.

It is no longer MovieClip.prototype… it is now a \_global function, and the contents of it has slightly changed so allow the ability for multiple windows.

We got this question many many times before, so I decided to rewrite it and Kirupa updated the tutorial.

---

<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:** [October 27, 2003, 5:27am UTC](https://forum.kirupa.com/t/custom-new-window/34024/6 "2003-10-27T05:27:42Z")

</div>

seretha,

i’m changing these in each button:

address = "url"  
target\_winName = “title”

and, the new window doesn’t pop up.
