简体   繁体   English

如何在没有浏览器工具栏的情况下从Flex创建弹出窗口?

[英]How do I create a popup from Flex without a browser toolbar?

I'm trying to launch a popup window from Flex, but the popup window needs to have certain properties as one can usually specify with the JavaScript window.open. 我正在尝试从Flex启动一个弹出窗口,但是该弹出窗口需要具有某些属性,因为通常可以使用JavaScript window.open指定该属性。 For example, the popup window should not have a browser toolbar or URL box. 例如,弹出窗口不应具有浏览器工具栏或URL框。

I've tried using navigateToURL, which works fine, but I can't find a way to specify the popup window properties. 我试过使用navigationToURL,效果很好,但是找不到指定弹出窗口属性的方法。

I've tried using ExternalInterface.call, but the popup gets blocked when calling window.open directly, or even creating a custom JS function that calls window.open. 我尝试使用ExternalInterface.call,但是直接调用window.open甚至创建调用window.open的自定义JS函数时,弹出窗口都会被阻塞。

Help! 救命!

Thanks! 谢谢!

I don't think it's even possible to disable the browser toolbar or URL box in a lot of browsers (I certainly do not allow it on any of the browsers I use). 我认为在许多浏览器中甚至都不可能禁用浏览器工具栏或URL框(我当然不允许在我使用的任何浏览器上使用它)。

If you're using navigateToURL, why can't the page you're opening run the JS to try to disable the toolbar and URL? 如果您使用的是NavigationToURL,为什么打开的页面无法运行JS来尝试禁用工具栏和URL? I think you can also attach attributes to the URL if you wanted to send properties over. 我想,如果您想发送属性,也可以将属性附加到URL。

You can use PopUpManager class of Flex for creating custom pop up box. 您可以使用Flex的PopUpManager类创建自定义弹出框。

This example may help you. 本示例可能会为您提供帮助。 Custom PopUp 自定义弹出窗口

Check out AndrewT's blog about checking for popup blockers. 查阅AndrewT的博客,了解检查弹出窗口阻止程序。 If not blocked, then use ExternalInterface; 如果没有阻塞,则使用ExternalInterface; otherwise use the flex popup. 否则,请使用flex弹出窗口。

Detecting Popup Blockers 检测弹出窗口阻止程序

Or better yet, use SWFAddress v2.3 (javascript and AS3) modules. 或者更好的方法是使用SWFAddress v2.3(javascript和AS3)模块。 The AS3 has SWFAddress::popup() facade that proxies the poup call to the javascript. AS3具有SWFAddress :: popup()门面,可将​​对poup的调用代理到javascript。 You can modify the SWFAdress.js popup function to use Andrew's logic and return a status. 您可以修改SWFAdress.js弹出功能以使用安德鲁的逻辑并返回状态。 This would be a best practice: leveraging superlative SWFAddress library from flex for deeplinking, google analytics, and popups. 这将是最佳实践:利用来自flex的高级SWFAddress库进行深层链接,谷歌分析和弹出窗口。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM