# Problem with Centered Popup Window

**URL:** <https://forum.kirupa.com/t/problem-with-centered-popup-window/206719>\
**Category:** flash\
**Created:** [November 10, 2006, 5:19pm UTC](https://forum.kirupa.com/t/problem-with-centered-popup-window/206719 "2006-11-10T17:19:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fizzgig7](https://avatars.discourse-cdn.com/v4/letter/f/d9b06d/32.png) [@fizzgig7](https://forum.kirupa.com/u/fizzgig7)\
**Post date:** [November 10, 2006, 5:19pm UTC](https://forum.kirupa.com/t/problem-with-centered-popup-window/206719/1 "2006-11-10T17:19:54Z")

</div>

Hey everybody,

I downloaded the tutorial on how to do a centered popup window in Flash 8. However, what I’m trying to do is have a button launch a text file into a browser window instead of a website.

Here’s the code for the button:

on (release) {  
//customize the window that gets opened  
// 0 equals NO.  
// 1 equals YES.  
address = “[http://myhints.txt/modular/pop-up.htm](http://myhints.txt/modular/pop-up.htm)”;  
target\_winName = “myhints”;  
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);  
}

And the code on the first frame in the timeline which is verbatim from the tutorial:

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);”);  
}

Any help would be greatly appreciated.

Thanks!

Russ
