Does the Launch function activate the pop-up blocker in some browsers? I'm thinking most notably in FF, whose blocker is activated by Sitecube's default method for opening new windows.
Does the Launch function activate the pop-up blocker in some browsers? I'm thinking most notably in FF, whose blocker is activated by Sitecube's default method for opening new windows.
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Hey John...
I assume you've read this thread and are talking about the following code that the OP posted:
The ActionScript equivalent (as the above isn't AS) would just be executing the specified JavaScript. So, the expected behavior from using window.open() in plain ol' javascript, apply when it's executed from within a Flash applet.Code:function Launch(page) { OpenWin = this.open(page, "My HomePage", "toolbar=no,menubar=no,location=no,scrollbars=no,resizable=yes,width=550,height=250"); }
There is no native method in ActionScript called "Launch". That's just an arbitrary function name. To run JavaScript from within Flash, you would use the getURL() method, as such:
Does that make sense?Code:myBtn_btn.onRelease = function(){ getURL("javascript:alert('you clicked me')"); };
I'm with you, Medyman. Please accept my apologies for being confused at first about the Launch function. My question though is really in particular about FF and new windows propagated via Flash. I know that whatever Sitecube (a paid service for folks wishing to create all Flash sites without having to know anything about Flash) is doing to open a new window is activating FF's pop up blocker. It doesn't activate IE's pop up blocker.
Now, this is sort of an academic question, insofar as I have no relationship with Sitecube (other than tangentially via a mutual client), and Sitecube probably won't listen to any advice I may have for them, but they might. In your experience, is there a way, using Flash, to open a new window populated by a specific URL that will not activate FF's pop up blocker (with its default settings, without making an exception for the particular site that wants to open the pop up), or not? Or, is this an issue that you really are not that up on?
I hope I've made myself clear, if not - feel free to press me for more information.
Additionally, anyone else reading this that can shed light upon this issue, feel free to add your comments.
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Hey John...
Sorry for misunderstanding you earlier. I must first admit that my knowledge on this subject is very limited. I really question the utility of the popup, especially from within Flash, and thus haven't had the desire or reason to look too much into the subject. With that said, there are some workarounds.
Since Firefox 1.5 or so (I'm making that number up but it was somewhere aren't there), Fx has blocked windows created via the getURL() ActionScript method. Presumably this was due to the growing number of popups that were initiated with Flash as the popup blocker got smarter.
From my understanding, the reason that Flash popups don't work across browsers (I'm speaking about browsers as a whole here, but this is only really enforced by Fx and Safari) is because Flash objects aren't a part of the DOM's trusted display list. And as such, they're restricted from doing thins like display popups. The workaround for this that I've found is to explicitly declare a wmode in the Flash embed code (through whichever embedding method you choose). Here is something I just made up fairly quickly with Flash CS3. The AC_RunActiveContent.js file that ships with Flash was used to embed and automatically includes a wmode declaration. In my browser, the popup opens up fine, so this workaround seems to work.
I find that method to be rather crude though. As CS3's market share increases and with advancements in Firefox's Flash blocking abilities, this workaround might not work much longer.
If you're publishing content for Flash Player 8 or higher, the "real" way (and the technique I'd use) to propagate popups from Flash is to not to use Flash at all. Let me explain. Flash Player 8 and above ship with the ExternalInterface class (or External API). The External API allows communication between JavaScript within the HTML page and the embedded .swf. So, what should be done is to write a JavaScript function that will open a popup successfully. Then, call that JavaScript function from within the ActionScript using the External API. In this way the ActionScript (or Flash) is initiating the popup but the actual scripting is JavaScript and is less likely to be blocked by a browsers pop-up blocker.
That's as much advice as I can offer. Let me know if you have other questions, though I probably won't be able to answer them (though I'll try).
The demo you made up works in Opera and IE, but not in FF (2.0.0.14 - latest official distro, I believe). In FF I get a notification that a pop up has been blocked. FYI, I used Google as the test URL.
Your other suggested approach probably wouldn't work in that version of FF either, as the general rule is to not open pop ups unless 'user initiated' something like so:
'some.htm' can be a variable reference, as can 'target', and 'specifications', the later two being stand-ins for the actual values one may use in those fields anyway. The onclick event's function can even be external, as long as it doesn't try to switch the document to be opened in certain ways.HTML Code:<a href="whatever" onclick="window.open('some.htm', 'target', 'specifications');return false;">Whatever</a>
In short, FF 2.0.0.14 seems to see anything other than the above type construction as an unwanted pop up. However, there may be exceptions, if so, and if the Flash pop up implementation could be made to seem to fulfill one or more of those exceptions, it could work. IE, and Opera on the other hand, seem to make an exception for your Flash demo - seeing it as 'user initiated'. It is the particular browser's interpretation of this 'user initiated' test that is at issue here.
From what you say, this has become relaxed in FF 3?
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Really? I'm testing on the same version (on 2 different PCs) and it worked. Not sure about the inconsistencies. Again, I'm in now way an expert on this stuff. I was just throwing some ideas other there.The demo you made up works in Opera and IE, but not in FF (2.0.0.14 - latest official distro, I believe). In FF I get a notification that a pop up has been blocked. FYI, I used Google as the test URL.
So, are you saying something like the below wouldn't work in Firefox?Your other suggested approach probably wouldn't work in that version of FF either, as the general rule is to not open pop ups unless 'user initiated' something like so:
It seems to work in my testing. Perhaps you can confirm or, if the case may be, explain why it won't.Code:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <script type="text/javascript"> <!-- function openWindow(url) { if( window.open(url, "windowname", "height=100,width=300" ) ) { return true; } return false; } // --> </script> </head> <body> <a href="#" onclick="openWindow('http://www.google.com')">Link to popup</a> </body> </html>
If the above does indeed work, then my second suggestion of the External API will indeed work. In theory, all Flash would be doing is mimicking the HTML anchor tag (as shown in this example). In fact, you really don't even need JavaScript on the HTML page to run the External API (as shown in this example).
Both examples work for me on Fx 2.0.0.14.
Actually, quite the opposite. From what I've read Fx 3 will have the ability to specifically block certain versions of the Flash Player (presumably older versions with known vulnerabilities). I can't imagine that a simple thing like adding the wmode (if indeed that workaround does work) will be a vulnerability in the Fx popup blocker for long.From what you say, this has become relaxed in FF 3?
Bookmarks