# Centered pop up - trouble with external swf

**URL:** <https://forum.kirupa.com/t/centered-pop-up-trouble-with-external-swf/270565>\
**Category:** Uncategorized\
**Created:** [September 11, 2008, 1:50am UTC](https://forum.kirupa.com/t/centered-pop-up-trouble-with-external-swf/270565 "2008-09-11T01:50:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ceebeenet](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ceebeenet/32/829_2.png) [@ceebeenet](https://forum.kirupa.com/u/ceebeenet)\
**Post date:** [September 11, 2008, 1:50am UTC](https://forum.kirupa.com/t/centered-pop-up-trouble-with-external-swf/270565/1 "2008-09-11T01:50:21Z")

</div>

Hi all,

I used the kirupa centered pop up tutorial and it works fine. But I am using it in an external swf that is loaded into my main website. And for this reason, the pop up function, that works on the movie alone, won’t work while loaded in my website.

Since I don’t know much about actionscript, I’m just guessing that it might have something to do with this script.

```auto

_root.[COLOR=#000050]openWinCentre[/COLOR] [COLOR=#0000ff]=[/COLOR] [COLOR=#006610]function[/COLOR] [COLOR=#0000ff]([/COLOR][COLOR=#0000d0]url[/COLOR], [COLOR=#000050]winName[/COLOR], [COLOR=#000050]w[/COLOR], [COLOR=#000050]h[/COLOR], [COLOR=#000050]toolbar[/COLOR],
[COLOR=#000050]location[/COLOR], [COLOR=#000050]directories[/COLOR], [COLOR=#0000d0]status[/COLOR], [COLOR=#000050]menubar[/COLOR], [COLOR=#000050]scrollbars[/COLOR], [COLOR=#000050]resizable[/COLOR][COLOR=#0000ff])[/COLOR]
[COLOR=#0000ff]{[/COLOR] [COLOR=#0000d0]getURL[/COLOR] [COLOR=#0000ff]([/COLOR][COLOR=#666666]"javascript:var myWin; if(!myWin || myWin.closed)[/COLOR]
[COLOR=#666666]{myWin = window.open('"[/COLOR] [COLOR=#0000ff]+[/COLOR] [COLOR=#0000d0]url[/COLOR] [COLOR=#0000ff]+[/COLOR] [COLOR=#666666]"','"[/COLOR] [COLOR=#0000ff]+[/COLOR] [COLOR=#000050]winName[/COLOR] [COLOR=#0000ff]+[/COLOR] [COLOR=#666666]"','"[/COLOR] [COLOR=#0000ff]+[/COLOR]
[COLOR=#666666]"width="[/COLOR] [COLOR=#0000ff]+[/COLOR] [COLOR=#000050]w[/COLOR] [COLOR=#0000ff]+[/COLOR] [COLOR=#666666]",height="[/COLOR] [COLOR=#0000ff]+[/COLOR] [COLOR=#000050]h[/COLOR] [COLOR=#0000ff]+[/COLOR] [COLOR=#666666]",toolbar="[/COLOR] [COLOR=#0000ff]+[/COLOR] [COLOR=#000050]toolbar[/COLOR] [COLOR=#0000ff]+[/COLOR]
[COLOR=#666666]",location="[/COLOR] [COLOR=#0000ff]+[/COLOR] [COLOR=#000050]location[/COLOR] [COLOR=#0000ff]+[/COLOR] [COLOR=#666666]",directories="[/COLOR] [COLOR=#0000ff]+[/COLOR] [COLOR=#000050]directories[/COLOR] [COLOR=#0000ff]+[/COLOR] 
[COLOR=#666666]",status="[/COLOR] [COLOR=#0000ff]+[/COLOR] [COLOR=#0000d0]status[/COLOR] [COLOR=#0000ff]+[/COLOR] [COLOR=#666666]",menubar="[/COLOR] [COLOR=#0000ff]+[/COLOR] [COLOR=#000050]menubar[/COLOR] [COLOR=#0000ff]+[/COLOR]
[COLOR=#666666]",scrollbars="[/COLOR] [COLOR=#0000ff]+[/COLOR] [COLOR=#000050]scrollbars[/COLOR] [COLOR=#0000ff]+[/COLOR] [COLOR=#666666]",resizable="[/COLOR] [COLOR=#0000ff]+[/COLOR] [COLOR=#000050]resizable[/COLOR] [COLOR=#0000ff]+[/COLOR]
[COLOR=#666666]",top='+((screen.height/2)-("[/COLOR] [COLOR=#0000ff]+[/COLOR] [COLOR=#000050]h[/COLOR][COLOR=#0000ff]/[/COLOR][COLOR=#991010]2[/COLOR] [COLOR=#0000ff]+[/COLOR]
[COLOR=#666666]"))+',left='+((screen.width/2)-("[/COLOR] [COLOR=#0000ff]+[/COLOR]
 [COLOR=#000050]w[/COLOR][COLOR=#0000ff]/[/COLOR][COLOR=#991010]2[/COLOR] [COLOR=#0000ff]+[/COLOR] [COLOR=#666666]"))+'"[/COLOR] [COLOR=#0000ff]+[/COLOR] [COLOR=#666666]"')}else{myWin.focus();};void(0);"[/COLOR][COLOR=#0000ff])[/COLOR]; [COLOR=#0000ff]}[/COLOR] 

```

Is it “\_root” that needs to be changed to something else?

Hope someone can help me out with this. Thanks a lot.  
Catherine
