Centered pop up window not working

I am trying to use the centered popup window script to load a html file.

[color=Blue]on[/color] ([color=Blue]release[/color]) {

 address = [color=Blue]"page1.htm"[/color];
 target_winName = [color=Blue]"page1"[/color];
 width = 640;
 height = 530;
 toolbar = 0;
 [color=Blue]location[/color] = 0;
 directories = 0;
 [color=Blue]status[/color] = 0;
 menubar = 0;
 scrollbars = 0;
 resizable = 0;
 
 openWinCentre(address, target_winName, width, height, toolbar, [color=Blue]location[/color], directories, [color=Blue]status[/color], menubar, scrollbars, resizable);

 }

My flash site consists of a main swf file in which other swf files are loaded into.
when I preview the file which contains the script, the popup works fine, but when this file is loaded into the main .swf file, nothing happens

does anyone have an idea of what might be wrong?