<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>assertTrue: Workaround for Safari Blocking Flash Initiated Pop Ups</title>
    <link>http://www.asserttrue.com/articles/2007/08/22/workaround-for-safari-blocking-flash-initiated-pop-ups</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>powered by Pattern Park</description>
    <item>
      <title>Workaround for Safari Blocking Flash Initiated Pop Ups</title>
      <description>&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; Please see my announcement of a project based on the ideas in the post &lt;a href="http://www.asserttrue.com/articles/2009/04/29/navigatetowindow-project-added-to-github"&gt;here&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;Uncontrolled browser pop ups suck, and I&amp;#8217;m very thankful for pop up blockers.  There are times, however, when you want controlled pop ups.  It&amp;#8217;s these times &amp;#8211; the times when a user initiates the call to action &amp;#8211; when the browser&amp;#8217;s pop up blocker should let them through.  Browsers are pretty good at managing this when the user initiated action starts in &lt;span class="caps"&gt;HTML&lt;/span&gt;, and most also do a good job when the action starts in a &lt;span class="caps"&gt;SWF&lt;/span&gt;.  There&amp;#8217;s at least one big exception &amp;#8211; Safari.&lt;/p&gt;


	&lt;p&gt;The standard path in Flash to open a browser pop up is to use &lt;a href="http://livedocs.adobe.com/flex/201/langref/flash/external/ExternalInterface.html"&gt;ExternalInterface&lt;/a&gt; to call a JavaScript function in the wrapping &lt;span class="caps"&gt;HTML&lt;/span&gt; page that contains a window.open call.  This path works in all the browsers I tested in except for Safari, which leads me to believe this a Safari bug.&lt;/p&gt;


	&lt;p&gt;Luckily, if you want to open browser windows from a &lt;span class="caps"&gt;SWF&lt;/span&gt; in Safari there&amp;#8217;s a workaround other than disabling the &amp;#8220;Block Pop-Up Windows&amp;#8221;!  Check it out:&lt;/p&gt;


&lt;center&gt;
&lt;script type="text/javascript" src="/files/PopUp.js"&gt;&lt;/script&gt;

&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="popUpSwf" width="140" height="20" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"&gt;
&lt;param name="movie" value="/files/PopUp.swf" /&gt;
&lt;param name="quality" value="high" /&gt;
&lt;param name="bgcolor" value="#CCCCCC" /&gt;
&lt;param name="allowScriptAccess" value="always" /&gt;
&lt;param name="allowNetworking" value="all" /&gt;
&lt;embed src="/files/PopUp.swf" quality="high" bgcolor="#CCCCCC" width="140" height="20" name="popUpSwf" align="middle" play="true" loop="false" quality="high" allowScriptAccess="always" allowNetworking="all" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"&gt;
&lt;/embed&gt;
&lt;/object&gt;
&lt;/center&gt;

	&lt;p&gt;The workaround works by:&lt;/p&gt;</description>
      <pubDate>Wed, 22 Aug 2007 21:59:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:ff7706c6-953c-41dc-a2aa-0c6882f359b4</guid>
      <author>Ali Mills</author>
      <link>http://www.asserttrue.com/articles/2007/08/22/workaround-for-safari-blocking-flash-initiated-pop-ups</link>
      <category>actionscript</category>
      <category>bugs</category>
      <trackback:ping>http://www.asserttrue.com/articles/trackback/1448</trackback:ping>
    </item>
  </channel>
</rss>
