开发者

Opening popups from AS3 using ExternalInterface in Safari

开发者 https://www.devze.com 2022-12-11 20:25 出处:网络
I\'m using this code to open a popup ExternalInterface.call(\"function () { window.o开发者_如何学Pythonpen(\'\" + url + \"\',\'\" + title + \"\',\'\" + options + \"\'); }\");

I'm using this code to open a popup

ExternalInterface.call("function () { window.o开发者_如何学Pythonpen('" + url + "','" + title + "','" + options + "'); }");

for JavaScript people: calling ExternalInterface.call(string); from flash player lets the browser do eval(string)();

as this call is within a click handler, it even works perfectly with Firefox and IE, for Opera it lets you open the popup manually. But in Safari, it is always blocked silently. Anyone have an idea how circumvent this?

thanks

back2dos


I've run into this, and as far as I could tell there was no real solution... the only workaround I could find was essentially checking if window.open works, and if it doesn't use navigateToURL instead... I just found this link that explains this much better: http://www.asserttrue.com/articles/2007/08/22/workaround-for-safari-blocking-flash-initiated-pop-ups


You shouldn't be creating your function inside of AS3. That's probably one of the reasons you are getting bad behavior.

You should create your function in the HTML or JS files and call it with EI, and pass the arguments you need.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号