Products
Technologies

Developer resources

_blank - Avoiding the pop-up block

Avg. Rating 3.6

Problem

Flex's navigateToURL, while more powerful than it's predecessor _getURL, it often gets caught by browser pop-up blockers when used in conjunction with _blank

Solution

The following implementation utilizing an externalInterface call provides a working solution for this problem. However, this solution does require that Flash be embedded with allowScriptAccess = true.

Detailed explanation

Problem:  Click on almost any Flex application on the web that links to an external browser window. Did you get there?  If so, hoorah, if not....did you find yourself at the mercy of a pop-up blocker? What a nightmare!!!

There is no perfect solution, though progress is being made, with newer  Flash Player updates resolving some browser's issues. But I have implemented a work-a-round that will work for many of us.  It requires that you have access to the embedding code, and that you enable allowScriptAccess = true in order to utilize the externalInterface command. If you are able to do this, then this solution should work. I discuss it on my S.A.S.S.I.E. blog here  and provide a simple example with the ability to view source.

It involves two functions. The first determines the browser, the second specifies which method to launch the new window.

Report abuse

Related recipes