<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Popups Blocked in AS3 with navigateToURL()</title>
	<atom:link href="http://www.zorked.com/flash/flash-and-navigatetourl-popup-blocking/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zorked.com/flash/flash-and-navigatetourl-popup-blocking/</link>
	<description>Progressive Web Development</description>
	<lastBuildDate>Wed, 03 Mar 2010 14:50:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Eileen</title>
		<link>http://www.zorked.com/flash/flash-and-navigatetourl-popup-blocking/#comment-17662</link>
		<dc:creator>Eileen</dc:creator>
		<pubDate>Wed, 03 Feb 2010 14:19:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.zorked.com/flash/flash-and-popup-blocking/#comment-17662</guid>
		<description>i&#039;m still wondering how to use Roy&#039;s code in Jordan&#039;s script- i want to specify the size of the browser window.
thanks e</description>
		<content:encoded><![CDATA[<p>i'm still wondering how to use Roy's code in Jordan's script- i want to specify the size of the browser window.<br />
thanks e</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eileen</title>
		<link>http://www.zorked.com/flash/flash-and-navigatetourl-popup-blocking/#comment-17570</link>
		<dc:creator>Eileen</dc:creator>
		<pubDate>Tue, 26 Jan 2010 23:51:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.zorked.com/flash/flash-and-popup-blocking/#comment-17570</guid>
		<description>How does this fit into the Jordan&#039;s code?</description>
		<content:encoded><![CDATA[<p>How does this fit into the Jordan's code?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roy</title>
		<link>http://www.zorked.com/flash/flash-and-navigatetourl-popup-blocking/#comment-17418</link>
		<dc:creator>Roy</dc:creator>
		<pubDate>Tue, 12 Jan 2010 14:11:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.zorked.com/flash/flash-and-popup-blocking/#comment-17418</guid>
		<description>Ok, I found a solution and it worked great. With this code AS3:
&lt;code&gt;
mHMlink.addEventListener(MouseEvent.CLICK,openPopUp);

function openPopUp(evt:MouseEvent):void {
	var url:String = &quot;http://www.holidaymedia.nl/webdesign-holidaymedia.htm&quot;;
	var windowName:String = &quot;hm&quot;;
	var windowOptions:String = &quot;width=350,height=210,left=80,top=180&quot;;
	ExternalInterface.call( &quot;window.open&quot;, url, windowName, windowOptions );
}
&lt;/code&gt;

This code it works in all browsers including IE</description>
		<content:encoded><![CDATA[<p>Ok, I found a solution and it worked great. With this code AS3:<br />
<code><br />
mHMlink.addEventListener(MouseEvent.CLICK,openPopUp);</p>
<p>function openPopUp(evt:MouseEvent):void {<br />
	var url:String = "http://www.holidaymedia.nl/webdesign-holidaymedia.htm";<br />
	var windowName:String = "hm";<br />
	var windowOptions:String = "width=350,height=210,left=80,top=180";<br />
	ExternalInterface.call( "window.open", url, windowName, windowOptions );<br />
}<br />
</code></p>
<p>This code it works in all browsers including IE</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roy</title>
		<link>http://www.zorked.com/flash/flash-and-navigatetourl-popup-blocking/#comment-17410</link>
		<dc:creator>Roy</dc:creator>
		<pubDate>Tue, 12 Jan 2010 08:00:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.zorked.com/flash/flash-and-popup-blocking/#comment-17410</guid>
		<description>Here the html code for the pop-up but then in plain text:
a href=&quot;http://www.holidaymedia.nl/promo/popup_madeby.htm&quot; onclick=&quot;window.open(&#039;&#039;,&#039;hm&#039;,&#039;scrollbars=no,resizable=no,width=350,height=210&#039;);&quot; target=&quot;hm&quot; class=&quot;webdesign&quot;&gt;Design &amp; Realisatie: Holiday Media&lt;/a</description>
		<content:encoded><![CDATA[<p>Here the html code for the pop-up but then in plain text:<br />
a href="http://www.holidaymedia.nl/promo/popup_madeby.htm" onclick="window.open('','hm','scrollbars=no,resizable=no,width=350,height=210');" target="hm" class="webdesign"&gt;Design &amp; Realisatie: Holiday Media&lt;/a</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roy</title>
		<link>http://www.zorked.com/flash/flash-and-navigatetourl-popup-blocking/#comment-17409</link>
		<dc:creator>Roy</dc:creator>
		<pubDate>Tue, 12 Jan 2010 07:50:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.zorked.com/flash/flash-and-popup-blocking/#comment-17409</guid>
		<description>Ok, but how can make flash to open a real pop-up window like you do it in html:
&lt;a href=&quot;http://www.holidaymedia.nl/promo/popup_madeby.htm&quot; rel=&quot;nofollow&quot;&gt;Design &amp; Realisatie: Holiday Media&lt;/a&gt;

This html code that calls a javascript function will open the pop-up in all the browsers.

But....
If do this in as3, this would be the code:
function openPopUp(evt:MouseEvent):void {
	navigateToURL(js,&quot;_self&quot; );
}
var js:URLRequest=new URLRequest();
js.url = &quot;javascript:window.open(&#039;http://www.holidaymedia.nl/webdesign-holidaymedia.htm&#039;, &#039;hm&#039;,&#039;status=no,scrollbars=no,resizable=no,width=350,height=210,left=80,top=180&#039;);newWindow.focus(); void(0);&quot;;

mHMlink.addEventListener(MouseEvent.CLICK,openPopUp);
mHMlink.buttonMode = true;

That works perfect in FF, Chrome, safari, etc. But in IE it will block the pop-up. 
How can I work around this.

Greetz</description>
		<content:encoded><![CDATA[<p>Ok, but how can make flash to open a real pop-up window like you do it in html:<br />
<a href="http://www.holidaymedia.nl/promo/popup_madeby.htm">Design &amp; Realisatie: Holiday Media</a></p>
<p>This html code that calls a javascript function will open the pop-up in all the browsers.</p>
<p>But....<br />
If do this in as3, this would be the code:<br />
function openPopUp(evt:MouseEvent):void {<br />
	navigateToURL(js,"_self" );<br />
}<br />
var js:URLRequest=new URLRequest();<br />
js.url = "javascript:window.open('http://www.holidaymedia.nl/webdesign-holidaymedia.htm', 'hm','status=no,scrollbars=no,resizable=no,width=350,height=210,left=80,top=180');newWindow.focus(); void(0);";</p>
<p>mHMlink.addEventListener(MouseEvent.CLICK,openPopUp);<br />
mHMlink.buttonMode = true;</p>
<p>That works perfect in FF, Chrome, safari, etc. But in IE it will block the pop-up.<br />
How can I work around this.</p>
<p>Greetz</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jordan</title>
		<link>http://www.zorked.com/flash/flash-and-navigatetourl-popup-blocking/#comment-17404</link>
		<dc:creator>jordan</dc:creator>
		<pubDate>Mon, 11 Jan 2010 21:25:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.zorked.com/flash/flash-and-popup-blocking/#comment-17404</guid>
		<description>Hi Roy, generally Firefox will open in a new window but if you have the setting to open new windows as tabs, it will of course do that.

Your code and implementation is correct.</description>
		<content:encoded><![CDATA[<p>Hi Roy, generally Firefox will open in a new window but if you have the setting to open new windows as tabs, it will of course do that.</p>
<p>Your code and implementation is correct.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roy</title>
		<link>http://www.zorked.com/flash/flash-and-navigatetourl-popup-blocking/#comment-17401</link>
		<dc:creator>Roy</dc:creator>
		<pubDate>Mon, 11 Jan 2010 09:36:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.zorked.com/flash/flash-and-popup-blocking/#comment-17401</guid>
		<description>It doesn&#039;t work. The browser Firefox opens a new tab when I click on the link.

This is the code:

&lt;code&gt;
import com.zorked.URLNavigator;

...

function callLink(e:MouseEvent):void
{
URLNavigator.ChangePage(&quot;http://www.holidaymedia.nl&quot;, &quot;_blank&quot;);
}
mHMlink.addEventListener(MouseEvent.CLICK, callLink);
mHMlink.buttonMode = true;
&lt;/code&gt;

&lt;code&gt;
/**
* Flash AS3 Page Change Utility
* @author Jordan Ambra
* @version 1.2
* http://www.zorked.com
* http://www.zorked.com/flash/flash-and-navigatetourl-popup-blocking/
*/

package com.zorked {
	import flash.external.ExternalInterface;
	import flash.net.*;
	
	public class URLNavigator {
		
		/**
		 * Utility function to wrap up changing pages. Avoids over-aggressive popup blockers.
		 * @param url		The URL to change to. Either a String or a URLRequest
		 * @param window	The target browser window/tab, generally _self, _top, or _blank
		 * @usage URLNavigator.ChangePage(&quot;http://www.google.com&quot;, &quot;_blank&quot;);
		 */
		public static function ChangePage(url:*, window:String = &quot;_self&quot;):void {
			var req:URLRequest = url is String ? new URLRequest(url) : url;
			if (!ExternalInterface.available) {
				navigateToURL(req, window);
			} else {
				var strUserAgent:String = String(ExternalInterface.call(&quot;function() {return navigator.userAgent;}&quot;)).toLowerCase();
				if (strUserAgent.indexOf(&quot;firefox&quot;) != -1 &#124;&#124; (strUserAgent.indexOf(&quot;msie&quot;) != -1 &amp;&amp; uint(strUserAgent.substr(strUserAgent.indexOf(&quot;msie&quot;) + 5, 3)) &gt;= 7)) {
					ExternalInterface.call(&quot;window.open&quot;, req.url, window);
				} else {
					navigateToURL(req, window);
				}
			}
		}
		
	}
	
}
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>It doesn't work. The browser Firefox opens a new tab when I click on the link.</p>
<p>This is the code:</p>
<p><code><br />
import com.zorked.URLNavigator;</p>
<p>...</p>
<p>function callLink(e:MouseEvent):void<br />
{<br />
URLNavigator.ChangePage("http://www.holidaymedia.nl", "_blank");<br />
}<br />
mHMlink.addEventListener(MouseEvent.CLICK, callLink);<br />
mHMlink.buttonMode = true;<br />
</code></p>
<p><code><br />
/**<br />
* Flash AS3 Page Change Utility<br />
* @author Jordan Ambra<br />
* @version 1.2<br />
* <a href="http://www.zorked.com">http://www.zorked.com</a><br />
* <a href="http://www.zorked.com/flash/flash-and-navigatetourl-popup-blocking/">http://www.zorked.com/flash/flash-and-navigatetourl-popup-blocking/</a><br />
*/</p>
<p>package com.zorked {<br />
	import flash.external.ExternalInterface;<br />
	import flash.net.*;</p>
<p>	public class URLNavigator {</p>
<p>		/**<br />
		 * Utility function to wrap up changing pages. Avoids over-aggressive popup blockers.<br />
		 * @param url		The URL to change to. Either a String or a URLRequest<br />
		 * @param window	The target browser window/tab, generally _self, _top, or _blank<br />
		 * @usage URLNavigator.ChangePage("http://www.google.com", "_blank");<br />
		 */<br />
		public static function ChangePage(url:*, window:String = "_self"):void {<br />
			var req:URLRequest = url is String ? new URLRequest(url) : url;<br />
			if (!ExternalInterface.available) {<br />
				navigateToURL(req, window);<br />
			} else {<br />
				var strUserAgent:String = String(ExternalInterface.call("function() {return navigator.userAgent;}")).toLowerCase();<br />
				if (strUserAgent.indexOf("firefox") != -1 || (strUserAgent.indexOf("msie") != -1 &amp;&amp; uint(strUserAgent.substr(strUserAgent.indexOf("msie") + 5, 3)) &gt;= 7)) {<br />
					ExternalInterface.call("window.open", req.url, window);<br />
				} else {<br />
					navigateToURL(req, window);<br />
				}<br />
			}<br />
		}</p>
<p>	}</p>
<p>}<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kat</title>
		<link>http://www.zorked.com/flash/flash-and-navigatetourl-popup-blocking/#comment-17339</link>
		<dc:creator>Kat</dc:creator>
		<pubDate>Wed, 06 Jan 2010 08:01:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.zorked.com/flash/flash-and-popup-blocking/#comment-17339</guid>
		<description>Thanks very much - that works great for me. You&#039;ve been extremely helpful!</description>
		<content:encoded><![CDATA[<p>Thanks very much - that works great for me. You've been extremely helpful!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Magnus M</title>
		<link>http://www.zorked.com/flash/flash-and-navigatetourl-popup-blocking/#comment-17033</link>
		<dc:creator>Magnus M</dc:creator>
		<pubDate>Fri, 18 Dec 2009 12:12:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.zorked.com/flash/flash-and-popup-blocking/#comment-17033</guid>
		<description>Never mind.
It open in a new window when i run the flash on the web instead of Flash CS4.

As I said before. works great. :)</description>
		<content:encoded><![CDATA[<p>Never mind.<br />
It open in a new window when i run the flash on the web instead of Flash CS4.</p>
<p>As I said before. works great. <img src='http://www.zorked.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Magnus M</title>
		<link>http://www.zorked.com/flash/flash-and-navigatetourl-popup-blocking/#comment-17031</link>
		<dc:creator>Magnus M</dc:creator>
		<pubDate>Fri, 18 Dec 2009 10:16:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.zorked.com/flash/flash-and-popup-blocking/#comment-17031</guid>
		<description>Hi, works like a charm!!!
very nice.

I have a questiong though.
I have set my browser to open all new windows in a new tab and when i call URLNavigator it opens, as expected, in a new tab in the existing window.
is it possible to go around this problem?</description>
		<content:encoded><![CDATA[<p>Hi, works like a charm!!!<br />
very nice.</p>
<p>I have a questiong though.<br />
I have set my browser to open all new windows in a new tab and when i call URLNavigator it opens, as expected, in a new tab in the existing window.<br />
is it possible to go around this problem?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
