PDA

View Full Version : ExternalInterface always opens new window



pkarpenko
February 13th, 2008, 01:25 PM
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


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

The JS function is very simple:


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?

paularmstrong
February 13th, 2008, 04:35 PM
window.open() is to open a new window.

try window.location = "";

pkarpenko
February 15th, 2008, 06:26 PM
window.open() is to open a new window.

try window.location = "";

No, I don't want it to open in the same window. I want it to open in a new window with name "blah" .. if there's already a window with name "blah", it should open in that window. This is standard window.open() functionality and works this way for normal HREF links, but not with ExternalInterface.