# SWF file launching pop-up window

**URL:** <https://forum.kirupa.com/t/swf-file-launching-pop-up-window/34604>\
**Category:** flash\
**Created:** [November 4, 2003, 2:02pm UTC](https://forum.kirupa.com/t/swf-file-launching-pop-up-window/34604 "2003-11-04T14:02:03Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![visualidea](https://avatars.discourse-cdn.com/v4/letter/v/57b2e6/32.png) [@visualidea](https://forum.kirupa.com/u/visualidea)\
**Post date:** [November 4, 2003, 2:02pm UTC](https://forum.kirupa.com/t/swf-file-launching-pop-up-window/34604/1 "2003-11-04T14:02:03Z")

</div>

I am putting a web site on a CD, using the Flash projector. I have used the tutorial for the Centered Pop-Up Window. Works great! Now I’m having a hard time making it work from the CD. I have searched but haven’t found this similar problem.

All html files, images are in folders on the CD (Portlgpages) folder. The code for the window is:

on (release) {  
//customize the window that gets opened  
// 0 equals NO.  
// 1 equals YES.  
address = “[http://www.eddygraphicdesign.com/Portlgpages/ill\_08.html](http://www.eddygraphicdesign.com/Portlgpages/ill_08.html)”;  
target\_winName = “popup\_08”;  
width = 288;  
height = 650;  
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);  
}

For example, I’ve changed the address to Portlgpages/ill\_08.html but it doesn’t work. Any suggestions?

---

<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:** [November 4, 2003, 3:07pm UTC](https://forum.kirupa.com/t/swf-file-launching-pop-up-window/34604/2 "2003-11-04T15:07:00Z")

</div>

> [http://www.eddygraphicdesign.com/Portlgpages/ill\_08.html](http://www.eddygraphicdesign.com/Portlgpages/ill_08.html)  
> is one of your files ?  
> If it’s the case in wich folder is the .swf wich launch the popup and the html that has to be in the popup ?

---

<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:** [November 4, 2003, 3:59pm UTC](https://forum.kirupa.com/t/swf-file-launching-pop-up-window/34604/3 "2003-11-04T15:59:48Z")

</div>

I want my swf file to launch html pages. There are several of them (portfolio images).

The swf file is in a main folder. Also in that folder is a folder called Portlgpages. That is where the html pages are.

It workes if I just use getURL but then I don’t get the specific sized html pages like in the tutorial.

Go to [www.eddygraphicdesign.com](http://www.eddygraphicdesign.com) in the portfolio section to see what I mean. I would like that to take that whole site and make to a CD.

---

<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:** [November 4, 2003, 4:34pm UTC](https://forum.kirupa.com/t/swf-file-launching-pop-up-window/34604/4 "2003-11-04T16:34:37Z")

</div>

try ‘Portlgpages/ill\_08.html’ not " "

---

<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:** [November 4, 2003, 5:41pm UTC](https://forum.kirupa.com/t/swf-file-launching-pop-up-window/34604/5 "2003-11-04T17:41:40Z")

</div>

Still the same problem. It brings up a blank I.E. page. Then a message saying “Specified Server could not be found” then a smaller i.e. window with the target name on the title bar, nothing inside the window.

---

<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:** [November 4, 2003, 5:49pm UTC](https://forum.kirupa.com/t/swf-file-launching-pop-up-window/34604/6 "2003-11-04T17:49:52Z")

</div>

I don’t get it. If I clear all that code and just put:

on (release) {  
getURL(“Portlgpages/ill\_08.html”);  
}

it works. But then I’m not getting my specific centered window, size, etc.

---

<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:** [November 4, 2003, 5:57pm UTC](https://forum.kirupa.com/t/swf-file-launching-pop-up-window/34604/7 "2003-11-04T17:57:25Z")

</div>

It’s strange, mayber you can try at this adress, i made my pop up with it : [http://flash-db.com/PopUp/](http://flash-db.com/PopUp/)

---

<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:** [November 4, 2003, 6:30pm UTC](https://forum.kirupa.com/t/swf-file-launching-pop-up-window/34604/8 "2003-11-04T18:30:33Z")

</div>

Perhaps javascript doesn’t work with SWF’s?

---

<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:** [November 4, 2003, 6:40pm UTC](https://forum.kirupa.com/t/swf-file-launching-pop-up-window/34604/9 "2003-11-04T18:40:11Z")

</div>

try this [AS]on (release) {  
getURL (“javascript:NewWindow=window.open(‘Portlgpages/ill\_08.html’,‘newWin’,‘width=288,height=650,left=0,top=0,toolbar=No,location=No,scrollbars=Yes,status=No,resizable=No,fullscreen=No’); NewWindow.focus(); screen\_height = window.screen.availHeight; screen\_width = window.screen.availWidth; left\_point = parseInt(screen\_width/2)-(288/2); top\_point = parseInt(screen\_height/2)-(650/2); setTimeout(‘NewWindow.moveTo(left\_point,top\_point)’,100); void(0);”);  
}{[/AS]

---

<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:** [November 4, 2003, 6:42pm UTC](https://forum.kirupa.com/t/swf-file-launching-pop-up-window/34604/10 "2003-11-04T18:42:21Z")

</div>

sorry [AS]  
on (release) {  
getURL  
(“javascript:NewWindow=window.open(‘Portlgpages/ill\_08.html’,‘newWin’,‘width=288,height=650,left=0,top=0,toolbar=No,location=No,scrollbars=Yes,status=No,resizable=No,fullscreen=No’); NewWindow.focus(); screen\_height = window.screen.availHeight; screen\_width = window.screen.availWidth; left\_point = parseInt(screen\_width/2)-(288/2); top\_point = parseInt(screen\_height/2)-(650/2); setTimeout(‘NewWindow.moveTo(left\_point,top\_point)’,100); void(0);”);[/AS]

---

<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:** [November 4, 2003, 6:44pm UTC](https://forum.kirupa.com/t/swf-file-launching-pop-up-window/34604/11 "2003-11-04T18:44:04Z")

</div>

there’s a problem replace (“about :new Window” by ("javascript:NewWindow=

---

<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:** [November 4, 2003, 6:56pm UTC](https://forum.kirupa.com/t/swf-file-launching-pop-up-window/34604/12 "2003-11-04T18:56:33Z")

</div>

Sorry but that doesn’t work either. This time it won’t launch anything.

---

<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:** [November 4, 2003, 7:06pm UTC](https://forum.kirupa.com/t/swf-file-launching-pop-up-window/34604/13 "2003-11-04T19:06:48Z")

</div>

This is the code I used for ma site…really helpful…got this function that passes on the resolution of popups and html links…works fine…it should help ya somehow or the other…

> 

[COLOR=blue]  
[FONT=courier new]  
\<script\>  
// Code reference [http://devlab.swift3d.com](http://devlab.swift3d.com)

mw=0;  
function popup(x,y,filename){

```
xresnow = x;
yresnow = y;
if (navigator.appVersion.indexOf("Mac")!=-1 && document.all) {
		xresnow-=0;
		yresnow-=0;
}
xl = (screen.availWidth/2)-(xresnow/2);
tt = (screen.availHeight/2)-(yresnow/2);

```

if (document.all) mw=window.open(filename,‘New’,‘scrollbars=no,width=’+xresnow+‘,height=’+yresnow+‘,left=’+xl+‘,top=’+tt);  
else {  
if (parseFloat(navigator.appVersion)\<4.75)  
mw=window.open(filename,‘New’,‘left=’+xl+‘,top=’+tt+‘,width=’+x+‘,height=’+y+‘,toolbar=0,status=0,location=0’);  
else {  
mw=window.open(filename,‘New’,‘scrollbars=no,toolbar=0,status=0,location=0’);  
setTimeout(“mwFix(”+xl+“,”+tt+“,x,y)”,10);  
}  
}

document.location=“email.html”;  
}  
\</script\>  
[/FONT]  
[/COLOR]

[EDIT]  
Now, to get the thing working in flash, just make a button that links to the name of the function with the arguments…

Just geturl to this:  
j a v a s c r i p t : p o p u p ( 7 7 0 , 5 7 0 , ’ p o p u p . h t m l ’ ) ;

That should work I guess…

[/EDIT]

---

<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:** [November 4, 2003, 8:08pm UTC](https://forum.kirupa.com/t/swf-file-launching-pop-up-window/34604/14 "2003-11-04T20:08:56Z")

</div>

The very first code I posted works great for the web site…except I can’t get it to work for the CD from the SWF file. Even though all html files are there in a folder. I know there’s got to be a way to make it work.

I’m not sure where to apply the above code. Could you be more specific?
