Macromedia (ok, Adobe – some habits die hard…) themselves seemed also to advocate this as a valid approach. Where was I going wrong?
Eventually I downloaded the sample files (availabled for Mac or PC) and examined the code – all three lines of it! There was only one difference – the assignment of the getURL() method to the onRelease() event, rather than the onPress() event in my example above. Unconvinced this would make a difference, I duly updated my code so as to eliminate the possibility and guess what? It worked! My pop-ups were now being allowed to open.
There doesn’t seem to be much in the way of online documentation for this phenomenon. Brian’s post over at Midwest Macromedia Studio Users Group comes near the mark, but rather than the method of assigning the event to the button, it is actually the event type itself that plays the significant role in deciding whether a blocker will be triggered or not. onPress() events will always trigger a pop-up blocker while onRelease() events escape undetected.
So given that I’m happy to use an onRelease() event rather than on onPress() event, is everything now rosy? Unfortunately not. I also needed to include links opened in new windows using inline anchor tags within HTML formatted textfields. Here’s an example of how the code would be assigned to the textfield:
myTf.htmlText = 'Click <a target="_blank" xhref="http://www.bbc.co.uk/" mce_href="http://www.bbc.co.uk/">here</a> to view';
This will invariably result in the new window being blocked.
If anyone has a workaround for this, please let me know!