views:

2024

answers:

3

Hi there,

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. For example, the popup window should not have a browser toolbar or URL box.

I've tried using navigateToURL, which works fine, but I can't find a way to specify the popup window properties.

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.

Help!

Thanks!

+1  A: 

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).

If you're using navigateToURL, why can't the page you're opening run the JS to try to disable the toolbar and URL? I think you can also attach attributes to the URL if you wanted to send properties over.

CookieOfFortune
I'm pretty sure that most JS-compatible browsers support styling the popup via the window.open method, but Flex doesn't seem to support this... and I'm not sure of a way to do it on the fly (after the window has been opened)
Steve Middleton
CookieOfFortune
A: 

You can use PopUpManager class of Flex for creating custom pop up box.

This example may help you. Custom PopUp

Chinmay
I'm not looking to create an in-flex popup... I'm looking for a browser window popup.
Steve Middleton
A: 

Check out AndrewT's blog about checking for popup blockers. If not blocked, then use ExternalInterface; otherwise use the flex popup.

Detecting Popup Blockers

Or better yet, use SWFAddress v2.3 (javascript and AS3) modules. The AS3 has SWFAddress::popup() facade that proxies the poup call to the javascript. You can modify the SWFAdress.js popup function to use Andrew's logic and return a status. This would be a best practice: leveraging superlative SWFAddress library from flex for deeplinking, google analytics, and popups.