homepage Welcome to WebmasterWorld Guest from 54.197.15.196
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
Forum Library, Charter, Moderator: open

Flash and Shockwave Forum

    
Problem with Firefox Popup Blocker
How can I prevent getURL calls from being blocked by Firefox popup blocker?
Captaffy

10+ Year Member



 
Msg#: 3376499 posted 6:14 am on Jun 23, 2007 (gmt 0)

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]

 

mattclayb

5+ Year Member



 
Msg#: 3376499 posted 8:51 pm on Jun 25, 2007 (gmt 0)

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");
}

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved