The Nightmare that is “_blank”: Part II (resolved???)

UPDATE: I have found the issue with IE & pop-up blocking. It was not in fact the fault of SWFObject. Rather, the issue was a particular parameter entry: wmode=”transparent”

Yes, the simple removal of this entry caused IE’s pop-up blocking to cease. It appears I finally have a working solution – I tested on: XP (IE6, Firefox, Safari 3, Opera) & OSX (Firefox, Safari 3, Safari 2). The only caveat now being that the use of wmode=”transparent” causes IE to pop-up block.
Okay, I am putting this out to all of my readers…


I’ve almost got every browser working for my “_blank” clicks. The final exception is that on IE clicking is triggering a pop-up blocker. Surprisingly, it is not my code that appears to be the issue – or at least not directly – rather, it appears to be caused by the use of SWFObject to embed the .swf file. (We use SWFObject for our .swf embedding for a variety of reasons.)

Below are three links to my “Example 2” , each using a different loading method. Standard as generated by Flex, SWFObject 1.5, & SWFObject 2

http://www.easternstorm.net/sassie/example2/example2.html

http://www.easternstorm.net/sassie/example2/example2-swfobject.html

http://www.easternstorm.net/sassie/example2/example2-swfobject2.html

If anyone can provide insight as to why the use of SWFObject is triggering the IE pop-up blocker, please, please let me know!

– The Saj

PS – Here are a few additional links on “_blank” issues. These demonstrate examples of using Callback, which I have not implemented but might consider incorporating.

Insideria

AssertTrue

22 Responses to “The Nightmare that is “_blank”: Part II (resolved???)”


  1. 1 Jim February 12, 2008 at 10:10 pm

    I notice that it’s now a Nightmare with a capital “N” 🙂

  2. 2 thesaj February 13, 2008 at 9:20 am

    Hmm….must be my sub-conscience expressing it’s frustratioN.

    😉

  3. 3 Bartek Drozdz April 1, 2008 at 3:00 am

    Finally a solution that works (swfobject 1.5 and 2) in Firefox. Thanks! I also checked and it works on IE 6 and Safari 3.1 on Win. I didn’t test it on IE 7… It is sad such a basic functionallity is causing such big problems.

  4. 4 Jaz April 8, 2008 at 6:22 am

    I came across this topic while searching for an answer on exactly the same problem. I’m using SWFObject but it seems to work on all browsers aside from IE7. Any insight would be much appreciated.

  5. 5 thesaj April 8, 2008 at 9:47 am

    If I recall correctly, the wmode had an effect on IE. You can try changing it to “opaque” or “transparent” and seeing if that works.

    That said, when you say “all browsers” did you test both Safari 2 & Safari 3. They behave much differently.

    – Jason

  6. 6 Willow Wright June 3, 2008 at 1:11 pm

    Well, all of this is fine…..I really need to use wmode = “transparent” and that brings up the pop-ups blocked. And I’m not even asking the browser to open a new window…..not even asking for a target. No javascript to open anything new. And STILL I get the pop-ups blocked.

    I am about to junk AS3, and go back to AS2, in which I have NO problems of this sort.

    So far, I’ve not been able to use one AS3 script in Flash on my site, and I’ve had the new CS3 software for a WHILE.

    Does anyone have a solution for my issue? Thanks, WCW

  7. 7 Jonah June 3, 2008 at 6:52 pm

    Hello
    My name is Jonah Huggins, and I am a programmer trying to figure out a simple syntax problem that I am having with an AIR app that I am writing.

    So here is what I am trying to do…

    I am trying to send the text that is stored in a variable to my SQLite db. I have no idea what the syntax is but I know that it is simple…

    Here is a bit of my code where the problem occurs.

    private function postComment():void {

    var commentVAR:String = commentText.text;
    //Alert.show(commentVAR);

    var q:SQLStatement = new SQLStatement();
    q.text = “UPDATE data SET comment=commentVAR WHERE prim = 1”;
    q.sqlConnection = conn;
    q.addEventListener( SQLErrorEvent.ERROR, queryError );
    q.execute();

    //Alert.show(q.text);
    }

    As you can see I am trying to update a field by sending it the value of the variable “commentVAR”… We have tried countless syntaxes and researched for hours with no luck or example of what the syntax is for doing this simple thing, we have even tried just updating with commentText.text but “commentText.text” is what gets stored…

    Ps. Everything else works great, but when we try to get the variable’s data stored in the db it just stores “commentVAR” instead.

    If anyone could help me out on this it sure would be appreciated.

    Thank you so much :

    Jonah Huggins

  8. 8 maryb33 August 5, 2008 at 11:39 pm

    @Jonah:

    Try this:

    q.text = “UPDATE data SET comment=”+commentVAR+” WHERE prim = 1″;

    instead of;

    q.text = “UPDATE data SET comment=commentVAR WHERE prim = 1″;

    – Mary

  9. 9 hobbes2k September 10, 2008 at 3:24 pm

    @Jonah

    I’m a new to flash/flex development, but it looks to me like you are pretty well set up for a SQL Injection attack on your database. If you are not familiar with these, read up on them before you go further. I wish that I could direct you around this, but again I am not familiar enough with this language to help you…

    @Others
    Any other thoughts? Am I correct about this?

  10. 10 anonymous October 22, 2008 at 3:43 pm

    @Jonah

    As maryb33 points out, you need to use the + operator to concatenate your strings.

    But more importantly, heed the advice of hobbes2k about SQL injection. Otherwise you will be in for trouble and headaches. Even non-attacks will cause trouble, for example if they put a ; in the text field.

  11. 11 jammin November 6, 2008 at 8:25 pm

    Hi there,

    I checked all three solutions here. All worked on a mac with firefox3. I looked at page source to see how one places the flash object into the HTML. That part I understood.

    But what actionscript did you use to for the button?

    I think you used Flex, right?

    What I am trying to do is have my button (in flash) link to a page opening a blank firefox 3 window. So far no luck…

    I could really use the help 🙂

    Thanks

  12. 12 thesaj November 6, 2008 at 9:49 pm

    What have you tried so far? That might help us with a resolution.

  13. 13 Arthur Gouveia November 25, 2008 at 6:33 am

    Man, i did what u said, but still no success… Can u help me?

    I copied and pasted your AS in one file, and on my MXML, I imported it, using it this way:

    URLUtil.openWindow(“../includes/graficoHTML.php?filename=” + filename, “_blank”)

    It should call this PHP, that writes an HTML with an image, that is passed by get(as u can see). As far as I see, my code is just like yours.

    On the HTML generated by the Flex Builder, i´ve set every “allowScriptAccess” to “always”, and also on AC_OETags.js…

    Still, everytime I click to open that URL, the Browser blocks it.

    Can you pleeeeease help me out?

  14. 15 mike June 4, 2009 at 12:50 pm

    thanks a lot for that great example, I’ve been reading & testing a couple already, this is the best so far !

    • 16 dayvid July 15, 2009 at 3:17 pm

      Thanks for your work. When I publish a .swf from your fla (navigatetourl.fla) it works. But when I make my own fla and build it exactly like yours it doesn’t work. I’ve matched the fla’s perfect and the html pages are identical, but I can recreate your fix. Do you have any ideas?

      Thanks!

  15. 17 Pritam February 22, 2011 at 5:52 am

    Great man, thanks it did help!


  1. 1 Problems using navigateToURL - aron / philipp development blog Trackback on April 8, 2008 at 4:59 am
  2. 2 UPDATE on “_blank” / navigateToURL() issue « The Saj - S.A.S.S.I.E. Trackback on May 30, 2008 at 4:04 pm
  3. 3 FlexMerge » Opening External Links from AS3 Trackback on June 30, 2008 at 12:15 pm
  4. 4 Problems using navigateToURL « Ramblings Trackback on July 5, 2008 at 3:34 pm
  5. 5 Opening External Links in new window from AS3 — Entrepreneur Geek Trackback on November 27, 2008 at 1:28 am

Leave a reply to Willow Wright Cancel reply




February 2008
M T W T F S S
 123
45678910
11121314151617
18192021222324
2526272829  


Awesome Developer Conferences


Nxtbook MediaFormer Employer - Great Company



The Saj... "Dark Lord of the SWF"