Welcome to WebmasterWorld Guest from 54.166.222.116

Forum Moderators: open

Message Too Old, No Replies

Problem with Firefox Popup Blocker

How can I prevent getURL calls from being blocked by Firefox popup blocker?

     
6:14 am on Jun 23, 2007 (gmt 0)

10+ Year Member



I have a swf that is hosted on www.myfirstsite.com, and embedded on a page on www.mysecondsite.com. When you click on a movieclip on the swf (captured by onMouseDown()), the following function is called:

getURL("http://www.myfirstsite.com/", "_blank");

In IE, everything works as expected; a new browser window opens up and goes to www.myfirstsite.com. But in FireFox (tested on 1.5.0.12 and 2.0.0.4) the popup blocker blocks the new browser window from opening.
I've read that this is 'normal' behavior, but I'm wondering how some swfs, like an embedded YouTube movie, are able to open a new browser window without a problem (for instance when you click on the player embedded on another site).

Thanks in advance for the help, and I'm very new to Flash, so don't assume I haven't done something silly :)

[edited by: Captaffy at 6:42 am (utc) on June 23, 2007]

8:51 pm on Jun 25, 2007 (gmt 0)

10+ Year Member



don't use target _blank, use javascript to handle the popup instead.

Embed your java for handling the popup on the same page as you are embedding the Flash. Where you host the swf is immaterial.

On your html page within the head tags place this javascript (set the width and height to what you need)-

<SCRIPT LANGUAGE="JavaScript">
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=430,height=550');");
}
</script>

on your button place the actionscript -

on(release){
getURL("Javascript: popUp("urltopopup.html");
}

 

Featured Threads

Hot Threads This Week

Hot Threads This Month