# Popup Window In Flash

**URL:** https://forum.kirupa.com/t/popup-window-in-flash/20922
**Category:** flash
**Created:** [May 14, 2003, 8:06pm UTC](https://forum.kirupa.com/t/popup-window-in-flash/20922 "2003-05-14T20:06:18Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Zero\_Oxygen](https://avatars.discourse-cdn.com/v4/letter/z/c77e96/32.png) [@Zero\_Oxygen](https://forum.kirupa.com/u/Zero_Oxygen)
#### Post date: [May 14, 2003, 8:06pm UTC](https://forum.kirupa.com/t/popup-window-in-flash/20922/1 "2003-05-14T20:06:18Z")

</div>

I went through the tutorial on this site that shows you how to launch a popup window, from Flash, that is centered. The only thing is that I would like to be able to open multiple windows so customers can compare many different products. I tried a few things but can’t get it to work, PLEASE HELP!

---

<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: [May 14, 2003, 8:16pm UTC](https://forum.kirupa.com/t/popup-window-in-flash/20922/2 "2003-05-14T20:16:18Z")

</div>

did you try adding a \_blank? that would make it so that its anew windo every time…

---

<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: [May 14, 2003, 8:25pm UTC](https://forum.kirupa.com/t/popup-window-in-flash/20922/3 "2003-05-14T20:25:22Z")

</div>

Yeah, it didn’t work. Here is the link to the tutorial and code I used, well similar.

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

Someone suggest changing the target\_winName for each instance but that didn’t work either.

---

<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: [May 14, 2003, 8:26pm UTC](https://forum.kirupa.com/t/popup-window-in-flash/20922/4 "2003-05-14T20:26:53Z")

</div>

Ok it’s an easy stuff… all you need is a html file that will be loaded when you click on a flash buton…

Suppose you call your html file : load.html  
on the first frame of you fla use this 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);”);  
}

then on the bouton that will be use to load you html file (load.html)

on the action use this code :

on (release) {  
//customize the window that gets opened  
// 0 equals NO.  
// 1 equals YES.  
address = “[http://www.yourdomain.com/load.html](http://www.yourdomain.com/load.html)”;  
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);

Bingo !!!

It should work now !!!

---

<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: [May 14, 2003, 8:30pm UTC](https://forum.kirupa.com/t/popup-window-in-flash/20922/5 "2003-05-14T20:30:55Z")

</div>

That is what I’m using but you can only upon 1 window at a time.

---

<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: [May 14, 2003, 8:47pm UTC](https://forum.kirupa.com/t/popup-window-in-flash/20922/6 "2003-05-14T20:47:40Z")

</div>

hmm i dont know then… sorry
