Pop-ups from the built-in .swf firewall

Situation: you have a .swf embedded in an html page, and when you click on something in a .swf, it needs to pop up without a chrome window. This would usually be quite simple - but consider Safari, which completely disables all window.open functions while its pop-up block is on (it throws an exception if the function is triggered by onclick, but does not take into account clicks in flash memory), as you can to create something that elegantly degrades (provides an alternative and roughly equivalent experience) for browsers that won't execute window.open?

(note: these are AS3 and Safari 3 for PC or Mac, which we are talking about - but more broadly, any browser that does not support or refuses to allow the javascript window.open function.)

+3
source share
2 answers

If your SWF is loaded with wmode='opaque'or wmode='transparent', then you may have JavaScript code to output the SWF, which will create an empty <div>one located above the SWF area. Something that <div>can handle the event onclickand create a popup, not Flash code.

+1
source

the div overlay was more complex than the project deserved - see code.google.com/p/popupfromflash for the code I came up with.

He tries to use ExternalInterface to set the window.open function, and if this does not work (especially in Safari), he will call back to the flash and offer him to open the ToURL navigator to open the window normally (instead of chrome)

0
source

All Articles