# ExternalInterface always opens new window

**URL:** <https://forum.kirupa.com/t/externalinterface-always-opens-new-window/251891>\
**Category:** flash\
**Created:** [February 13, 2008, 5:25pm UTC](https://forum.kirupa.com/t/externalinterface-always-opens-new-window/251891 "2008-02-13T17:25:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pkarpenko](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/pkarpenko/32/3051_2.png) [@pkarpenko](https://forum.kirupa.com/u/pkarpenko)\
**Post date:** [February 13, 2008, 5:25pm UTC](https://forum.kirupa.com/t/externalinterface-always-opens-new-window/251891/1 "2008-02-13T17:25:39Z")

</div>

I need to be able to control window parameters (size, toolbars, etc) of the browser windows I open from my SWF, so I’m calling a javascript function in the HTML page that holds my SWF by using

```auto
ExternalInterface.call("OpenPage", url, win_name, win_params);

```

The JS function is very simple:

```auto
function OpenPage(strUrl, target, params) {
       if (!params) params = '';
       var win = window.open(strUrl, target, params);
       win.focus();
}

```

The problem is that no matter what target (win\_name) I specify, it ALWAYS opens a new window. I’ve tried hardcoding the open call with window.open(strUrl, ‘SAME’, params); with no luck.

If I call the JS function from the HTML page, it works fine. Somewhere between the SWF and the JS, the window referencing gets messed up.

Anyone else encounter this or have any ideas?
