# Customized window help

**URL:** <https://forum.kirupa.com/t/customized-window-help/176187>\
**Category:** flash\
**Created:** [January 21, 2006, 6:37am UTC](https://forum.kirupa.com/t/customized-window-help/176187 "2006-01-21T06:37:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nohomedia](https://avatars.discourse-cdn.com/v4/letter/n/cdc98d/32.png) [@nohomedia](https://forum.kirupa.com/u/nohomedia)\
**Post date:** [January 21, 2006, 6:37am UTC](https://forum.kirupa.com/t/customized-window-help/176187/1 "2006-01-21T06:37:29Z")

</div>

I am trying to customize the windows I open from flash using javascript inside flash. I’ve done it sucessfully in another site, the only difference being the buttons on the successful one were in the root level of the site and this one is nested inside 2 mc’s.

This is the code I’m using:

this is in the “actions” layer:

```auto
this.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);"); 
} 
stop();

```

this is on the button itself:

```auto
on (release) { 
// 0 equals NO. 
// 1 equals YES. 
address = "[http://www.norwoodandhoehne.com/simcoeblackgallery.html](http://www.norwoodandhoehne.com/simcoeblackgallery.html)"; 
target_winName = "black drawings"; 
width = 820; 
height = 650; 
toolbar = 0; 
location = 0; 
directories = 0; 
status = 0; 
menubar = 0; 
scrollbars = 0; 
resizable = 0; 
//sends data back to the function 
openWinCentre(address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable); 
} 

```

the only difference in the code on the one that worked and the on that didn’t was that it said “\_root.openWinCentre = function” instead of "this.openWinCentre = function "

Any help would be hugely appreciated.
