<?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: Get current url to Flash swf using an External Interface call</title>
	<atom:link href="http://blog.circlecube.com/2008/01/tutorial/get-current-url-to-flash-swf-using-an-external-interface-call/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.circlecube.com/2008/01/tutorial/get-current-url-to-flash-swf-using-an-external-interface-call/</link>
	<description>Evan&#039;s Interactive Actionscript Exploration</description>
	<lastBuildDate>Thu, 11 Mar 2010 03:33:16 +0000</lastBuildDate>
	
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Hieu</title>
		<link>http://blog.circlecube.com/2008/01/tutorial/get-current-url-to-flash-swf-using-an-external-interface-call/#comment-1310</link>
		<dc:creator>Hieu</dc:creator>
		<pubDate>Thu, 04 Mar 2010 09:41:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.circlecube.com/2008/01/02/get-current-url-to-flash-swf-using-an-external-interface-call/#comment-1310</guid>
		<description>Thanks a lot for sharing.</description>
		<content:encoded><![CDATA[<p>Thanks a lot for sharing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: atasözleri</title>
		<link>http://blog.circlecube.com/2008/01/tutorial/get-current-url-to-flash-swf-using-an-external-interface-call/#comment-1303</link>
		<dc:creator>atasözleri</dc:creator>
		<pubDate>Thu, 25 Feb 2010 10:43:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.circlecube.com/2008/01/02/get-current-url-to-flash-swf-using-an-external-interface-call/#comment-1303</guid>
		<description>You are perfect!

I am too many time finding it, very nice and wonderful working.

Thanks again!</description>
		<content:encoded><![CDATA[<p>You are perfect!</p>
<p>I am too many time finding it, very nice and wonderful working.</p>
<p>Thanks again!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MicroAngelo</title>
		<link>http://blog.circlecube.com/2008/01/tutorial/get-current-url-to-flash-swf-using-an-external-interface-call/#comment-1149</link>
		<dc:creator>MicroAngelo</dc:creator>
		<pubDate>Mon, 22 Jun 2009 07:39:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.circlecube.com/2008/01/02/get-current-url-to-flash-swf-using-an-external-interface-call/#comment-1149</guid>
		<description>Hi,&lt;br&gt;&lt;br&gt;I don&#039;t really like to require users of my swf&#039;s to have to add and javascript, so instead I do this entirely in actionscript:&lt;br&gt;&lt;br&gt;ExternalInterface.call(&quot;eval&quot;,&quot;document.location.href&quot;);&lt;br&gt;&lt;br&gt;You have to use &quot;eval&quot; (evaluate) to work across all browsers (and &quot;document.location&quot; is safer than &quot;window.location&quot; in case you&#039;re in a frameset).&lt;br&gt;&lt;br&gt;HTH,&lt;br&gt;&lt;br&gt;MicroAngelo</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I don&#39;t really like to require users of my swf&#39;s to have to add and javascript, so instead I do this entirely in actionscript:</p>
<p>ExternalInterface.call(&#8220;eval&#8221;,&#8221;document.location.href&#8221;);</p>
<p>You have to use &#8220;eval&#8221; (evaluate) to work across all browsers (and &#8220;document.location&#8221; is safer than &#8220;window.location&#8221; in case you&#39;re in a frameset).</p>
<p>HTH,</p>
<p>MicroAngelo</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Og2t</title>
		<link>http://blog.circlecube.com/2008/01/tutorial/get-current-url-to-flash-swf-using-an-external-interface-call/#comment-1127</link>
		<dc:creator>Og2t</dc:creator>
		<pubDate>Mon, 08 Jun 2009 14:05:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.circlecube.com/2008/01/02/get-current-url-to-flash-swf-using-an-external-interface-call/#comment-1127</guid>
		<description>Thanks for the solution, that&#039;s what I was looking for.</description>
		<content:encoded><![CDATA[<p>Thanks for the solution, that&#8217;s what I was looking for.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Evan Mullins</title>
		<link>http://blog.circlecube.com/2008/01/tutorial/get-current-url-to-flash-swf-using-an-external-interface-call/#comment-1099</link>
		<dc:creator>Evan Mullins</dc:creator>
		<pubDate>Wed, 13 May 2009 17:54:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.circlecube.com/2008/01/02/get-current-url-to-flash-swf-using-an-external-interface-call/#comment-1099</guid>
		<description>This article claims to get the url of the page to the swf/flash. Not the url of the swf. You can find the url of the swf through other ways... try http://www.actionscript.org/forums/showthread.php3?p=816010 for starts</description>
		<content:encoded><![CDATA[<p>This article claims to get the url of the page to the swf/flash. Not the url of the swf. You can find the url of the swf through other ways&#8230; try <a href="http://www.actionscript.org/forums/showthread.php3?p=816010" rel="nofollow">http://www.actionscript.org/forums/showthread.php3?p=816010</a> for starts</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keith</title>
		<link>http://blog.circlecube.com/2008/01/tutorial/get-current-url-to-flash-swf-using-an-external-interface-call/#comment-1098</link>
		<dc:creator>Keith</dc:creator>
		<pubDate>Wed, 13 May 2009 16:57:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.circlecube.com/2008/01/02/get-current-url-to-flash-swf-using-an-external-interface-call/#comment-1098</guid>
		<description>This page claims to provide the URL to the SWF but it does not.  The example provided, and all of the alternative examples in the comments, provide the URL to the PAGE containing the SWF.</description>
		<content:encoded><![CDATA[<p>This page claims to provide the URL to the SWF but it does not.  The example provided, and all of the alternative examples in the comments, provide the URL to the PAGE containing the SWF.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Evan Mullins</title>
		<link>http://blog.circlecube.com/2008/01/tutorial/get-current-url-to-flash-swf-using-an-external-interface-call/#comment-1081</link>
		<dc:creator>Evan Mullins</dc:creator>
		<pubDate>Mon, 27 Apr 2009 16:56:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.circlecube.com/2008/01/02/get-current-url-to-flash-swf-using-an-external-interface-call/#comment-1081</guid>
		<description>Actually, it should be != rather than ==, and remember that variable names are caSe seNseTive, so your QStr and Qstr are not the same things.

this worked for me:

[cc lang=&quot;actionscript&quot;]
function geturlhttp() {
  //var urlPath = ExternalInterface.call(&quot;window.location.href.tostring&quot;);
  urlPath = &quot;http://www.adrian.com/adrian.html?test=qs&quot;;
  //trace (urlpath)

  var QStr:String = &quot;&quot;;
  if (urlPath.indexOf(&quot;?&quot;) != -1) {
    QStr = urlPath.substr(urlPath.indexOf(&quot;?&quot;), urlPath.length );
    trace(QStr);
  }

  getURL(&quot;http://www.adrian.com/adrian.html&quot; + QStr , &quot;_self&quot;);

}
[/cc]

</description>
		<content:encoded><![CDATA[<p>Actually, it should be != rather than ==, and remember that variable names are caSe seNseTive, so your QStr and Qstr are not the same things.</p>
<p>this worked for me:</p>
<div class="codecolorer-container actionscript mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br /></div></td><td><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">function</span> geturlhttp<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; <span style="color: #808080; font-style: italic;">//var urlPath = ExternalInterface.call(&quot;window.location.href.tostring&quot;);</span><br />
&nbsp; urlPath = <span style="color: #ff0000;">&quot;http://www.adrian.com/adrian.html?test=qs&quot;</span>;<br />
&nbsp; <span style="color: #808080; font-style: italic;">//trace (urlpath)</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">var</span> QStr:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;&quot;</span>;<br />
&nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>urlPath.<span style="color: #0066CC;">indexOf</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;?&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">!</span>= -1<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; QStr = urlPath.<span style="color: #0066CC;">substr</span><span style="color: #66cc66;">&#40;</span>urlPath.<span style="color: #0066CC;">indexOf</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;?&quot;</span><span style="color: #66cc66;">&#41;</span>, urlPath.<span style="color: #0066CC;">length</span> <span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>QStr<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; <span style="color: #66cc66;">&#125;</span><br />
<br />
&nbsp; <span style="color: #0066CC;">getURL</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;http://www.adrian.com/adrian.html&quot;</span> + QStr , <span style="color: #ff0000;">&quot;_self&quot;</span><span style="color: #66cc66;">&#41;</span>;<br />
<br />
<span style="color: #66cc66;">&#125;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adrian</title>
		<link>http://blog.circlecube.com/2008/01/tutorial/get-current-url-to-flash-swf-using-an-external-interface-call/#comment-1079</link>
		<dc:creator>Adrian</dc:creator>
		<pubDate>Sun, 26 Apr 2009 05:34:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.circlecube.com/2008/01/02/get-current-url-to-flash-swf-using-an-external-interface-call/#comment-1079</guid>
		<description>I correct the codes aand the issue is still existing.

I am still getting &quot;undefined&quot;. I also noticed that the code is working if I will assign a fixed URL value for the UrlPath variable.</description>
		<content:encoded><![CDATA[<p>I correct the codes aand the issue is still existing.</p>
<p>I am still getting &#8220;undefined&#8221;. I also noticed that the code is working if I will assign a fixed URL value for the UrlPath variable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Evan Mullins</title>
		<link>http://blog.circlecube.com/2008/01/tutorial/get-current-url-to-flash-swf-using-an-external-interface-call/#comment-1072</link>
		<dc:creator>Evan Mullins</dc:creator>
		<pubDate>Fri, 24 Apr 2009 14:46:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.circlecube.com/2008/01/02/get-current-url-to-flash-swf-using-an-external-interface-call/#comment-1072</guid>
		<description>@Adrian - this line is most likely giving you trouble:
if (urlPath.indexOf(”?”) -1)
should it read:
if (urlPath.indexOf(”?”) == -1) ?
let me know if that does it. happy scripting.</description>
		<content:encoded><![CDATA[<p>@Adrian &#8211; this line is most likely giving you trouble:<br />
if (urlPath.indexOf(”?”) -1)<br />
should it read:<br />
if (urlPath.indexOf(”?”) == -1) ?<br />
let me know if that does it. happy scripting.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adrian</title>
		<link>http://blog.circlecube.com/2008/01/tutorial/get-current-url-to-flash-swf-using-an-external-interface-call/#comment-1069</link>
		<dc:creator>Adrian</dc:creator>
		<pubDate>Fri, 24 Apr 2009 08:34:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.circlecube.com/2008/01/02/get-current-url-to-flash-swf-using-an-external-interface-call/#comment-1069</guid>
		<description>I tried to use your code below but it is not working in my end. 

The return value is &quot;undefined&quot;.
 
I am currently experimenting on how can I get the querystring of the current URL and append it in the url in of my getURL function. 

Below is a sample of my code.

*********************************************
import flash.external.*;

function geturlhttp()
{
//will contain the Current URL
var urlPath = ExternalInterface.call(&quot;window.location.href.tostring&quot;);

//trace (urlpath)
// result is undefined
//get current URL of the site
var QStr:String;
Qstr = &quot;&quot;;
if (urlPath.indexOf(&quot;?&quot;)  -1) 
{
	Qstr = urlPath.substr(urlPath.indexOf(&quot;?&quot;), urlPath.length );
}

getURL(&quot;http://www.adrian.com/adrian.html&quot; + Qstr , &quot;_self&quot;);

}


_root.LearnD.onRealease = function()

{
geturlhttp();
};

*********************************************
Whenever I click the LearnD button , I am redirected to this page.

http://www.adrian.com/adrian.htmlundefined</description>
		<content:encoded><![CDATA[<p>I tried to use your code below but it is not working in my end. </p>
<p>The return value is &#8220;undefined&#8221;.</p>
<p>I am currently experimenting on how can I get the querystring of the current URL and append it in the url in of my getURL function. </p>
<p>Below is a sample of my code.</p>
<p>*********************************************<br />
import flash.external.*;</p>
<p>function geturlhttp()<br />
{<br />
//will contain the Current URL<br />
var urlPath = ExternalInterface.call(&#8220;window.location.href.tostring&#8221;);</p>
<p>//trace (urlpath)<br />
// result is undefined<br />
//get current URL of the site<br />
var QStr:String;<br />
Qstr = &#8220;&#8221;;<br />
if (urlPath.indexOf(&#8220;?&#8221;)  -1)<br />
{<br />
	Qstr = urlPath.substr(urlPath.indexOf(&#8220;?&#8221;), urlPath.length );<br />
}</p>
<p>getURL(&#8220;http://www.adrian.com/adrian.html&#8221; + Qstr , &#8220;_self&#8221;);</p>
<p>}</p>
<p>_root.LearnD.onRealease = function()</p>
<p>{<br />
geturlhttp();<br />
};</p>
<p>*********************************************<br />
Whenever I click the LearnD button , I am redirected to this page.</p>
<p><a href="http://www.adrian.com/adrian.htmlundefined" rel="nofollow">http://www.adrian.com/adrian.htmlundefined</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->