<?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: the down lo on ExternalInterface and javascript injection via actionscript 3</title>
	<atom:link href="http://www.thaylin.com/blog/2009/05/21/the-down-lo-on-externalinterface-and-javascript-injection-via-actionscript-3/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thaylin.com/blog/2009/05/21/the-down-lo-on-externalinterface-and-javascript-injection-via-actionscript-3/</link>
	<description></description>
	<lastBuildDate>Thu, 09 Sep 2010 12:39:25 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Thaylin</title>
		<link>http://www.thaylin.com/blog/2009/05/21/the-down-lo-on-externalinterface-and-javascript-injection-via-actionscript-3/comment-page-1/#comment-3480</link>
		<dc:creator>Thaylin</dc:creator>
		<pubDate>Mon, 01 Mar 2010 16:03:08 +0000</pubDate>
		<guid isPermaLink="false">http://thaylin.info/blog/?p=211#comment-3480</guid>
		<description>Check to make sure this is set properly.

//SECOND WE NEED TO KNOW WHAT THE FLASH OBJECT IS TO ADD OUR METHOD CALLS
							// THIS ID IS SET IN THE SWF OBJECT CODE WITH A PARAMETER THAT&#039;S PASSED AS
							// var attributes = {id: &quot;flash_flash&quot;};
							// WHICH IS THEN PASSED INTO THE SWFOBJECT
							
							FCNY.flashObj = swfobject.getObjectById(&#039;flash_flash&#039;);

Otherwise the javascript won&#039;t know what to push any method calls to.</description>
		<content:encoded><![CDATA[<p>Check to make sure this is set properly.</p>
<p>//SECOND WE NEED TO KNOW WHAT THE FLASH OBJECT IS TO ADD OUR METHOD CALLS<br />
							// THIS ID IS SET IN THE SWF OBJECT CODE WITH A PARAMETER THAT&#8217;S PASSED AS<br />
							// var attributes = {id: &#8220;flash_flash&#8221;};<br />
							// WHICH IS THEN PASSED INTO THE SWFOBJECT</p>
<p>							FCNY.flashObj = swfobject.getObjectById(&#8217;flash_flash&#8217;);</p>
<p>Otherwise the javascript won&#8217;t know what to push any method calls to.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mike connor</title>
		<link>http://www.thaylin.com/blog/2009/05/21/the-down-lo-on-externalinterface-and-javascript-injection-via-actionscript-3/comment-page-1/#comment-3479</link>
		<dc:creator>mike connor</dc:creator>
		<pubDate>Mon, 01 Mar 2010 15:55:32 +0000</pubDate>
		<guid isPermaLink="false">http://thaylin.info/blog/?p=211#comment-3479</guid>
		<description>the 2nd example is not working for me.  I&#039;m not getting the trace back.</description>
		<content:encoded><![CDATA[<p>the 2nd example is not working for me.  I&#8217;m not getting the trace back.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Helmut Giese</title>
		<link>http://www.thaylin.com/blog/2009/05/21/the-down-lo-on-externalinterface-and-javascript-injection-via-actionscript-3/comment-page-1/#comment-144</link>
		<dc:creator>Helmut Giese</dc:creator>
		<pubDate>Mon, 13 Jul 2009 22:08:58 +0000</pubDate>
		<guid isPermaLink="false">http://thaylin.info/blog/?p=211#comment-144</guid>
		<description>Hi Thaylin,
many thanks for the explanation.
Now I will have to study all of this for a while ...
Best regards
Helmut</description>
		<content:encoded><![CDATA[<p>Hi Thaylin,<br />
many thanks for the explanation.<br />
Now I will have to study all of this for a while &#8230;<br />
Best regards<br />
Helmut</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thaylin</title>
		<link>http://www.thaylin.com/blog/2009/05/21/the-down-lo-on-externalinterface-and-javascript-injection-via-actionscript-3/comment-page-1/#comment-141</link>
		<dc:creator>Thaylin</dc:creator>
		<pubDate>Mon, 13 Jul 2009 14:59:09 +0000</pubDate>
		<guid isPermaLink="false">http://thaylin.info/blog/?p=211#comment-141</guid>
		<description>Hi Helmut!

The purpose of the 2nd example is to help you better understand adding callbacks and the communication between the JS and flash. There are a few different scenarios you can follow to get a visual response, which for some reason I commented out in the code (oopsie).
The first option is to uncomment line 41:

&quot;//setTimeout(timedOut, 1000);&quot;

This sets a timeout in the JS which then calls the timedOut method after 1000 milliseconds. This calls the flash object that was set in line 37:

FCNY.flashObj = swfobject.getObjectById(&#039;flash_flash&#039;);

since there was a callback added in the flash to listen for javascript calling that traceMe method it will then call the heyTrace method which traces out the string passed into it.

Another way to test this which gives you an immediate response that you can actually interact with is to enter this in your browsers url while debugging the app in the browser:

javascript:FCNY.flashObj.traceMe(&#039;TEST THE TRACE ME METHOD&#039;)

This will show the TEST THE TRACE ME METHOD text in the debuggin console.

Hope this helps a bit more!

[Edit]
It&#039;s important to realize, also, that the code within the CDATA tags is NOT actionscript but javascript. If you&#039;re using the latest Safari browser, you can view this in Develop&gt;Show Web Inspector&gt;Scripts which you can then peruse the scripts on the page. There you&#039;ll see the code you set within the actionscript. With FireFox you can see it with the Firebug extension.</description>
		<content:encoded><![CDATA[<p>Hi Helmut!</p>
<p>The purpose of the 2nd example is to help you better understand adding callbacks and the communication between the JS and flash. There are a few different scenarios you can follow to get a visual response, which for some reason I commented out in the code (oopsie).<br />
The first option is to uncomment line 41:</p>
<p>&#8220;//setTimeout(timedOut, 1000);&#8221;</p>
<p>This sets a timeout in the JS which then calls the timedOut method after 1000 milliseconds. This calls the flash object that was set in line 37:</p>
<p>FCNY.flashObj = swfobject.getObjectById(&#8217;flash_flash&#8217;);</p>
<p>since there was a callback added in the flash to listen for javascript calling that traceMe method it will then call the heyTrace method which traces out the string passed into it.</p>
<p>Another way to test this which gives you an immediate response that you can actually interact with is to enter this in your browsers url while debugging the app in the browser:</p>
<p>javascript:FCNY.flashObj.traceMe(&#8217;TEST THE TRACE ME METHOD&#8217;)</p>
<p>This will show the TEST THE TRACE ME METHOD text in the debuggin console.</p>
<p>Hope this helps a bit more!</p>
<p>[Edit]<br />
It&#8217;s important to realize, also, that the code within the CDATA tags is NOT actionscript but javascript. If you&#8217;re using the latest Safari browser, you can view this in Develop>Show Web Inspector>Scripts which you can then peruse the scripts on the page. There you&#8217;ll see the code you set within the actionscript. With FireFox you can see it with the Firebug extension.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Helmut Giese</title>
		<link>http://www.thaylin.com/blog/2009/05/21/the-down-lo-on-externalinterface-and-javascript-injection-via-actionscript-3/comment-page-1/#comment-137</link>
		<dc:creator>Helmut Giese</dc:creator>
		<pubDate>Mon, 13 Jul 2009 12:33:29 +0000</pubDate>
		<guid isPermaLink="false">http://thaylin.info/blog/?p=211#comment-137</guid>
		<description>Hi Thaylin,
never mind - I found &#039;Instructions for running ActionScript examples&#039; in FlexBuilder&#039;s help and it works (don&#039;t know what I did wrong last night).
Of course there is another little question:  :)
If I let all 3 examples run I see the alert by example 1 followed by the alert of example 3. Is example 2 supposed to produce any visual reaction? Can it be made to produce one (given that I have the most basic environment for your example - just the example and nothing else)?

Thanks for this sample project touching on an interesting subject.
Helmut</description>
		<content:encoded><![CDATA[<p>Hi Thaylin,<br />
never mind &#8211; I found &#8216;Instructions for running ActionScript examples&#8217; in FlexBuilder&#8217;s help and it works (don&#8217;t know what I did wrong last night).<br />
Of course there is another little question:  <img src='http://www.thaylin.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
If I let all 3 examples run I see the alert by example 1 followed by the alert of example 3. Is example 2 supposed to produce any visual reaction? Can it be made to produce one (given that I have the most basic environment for your example &#8211; just the example and nothing else)?</p>
<p>Thanks for this sample project touching on an interesting subject.<br />
Helmut</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Helmut Giese</title>
		<link>http://www.thaylin.com/blog/2009/05/21/the-down-lo-on-externalinterface-and-javascript-injection-via-actionscript-3/comment-page-1/#comment-136</link>
		<dc:creator>Helmut Giese</dc:creator>
		<pubDate>Mon, 13 Jul 2009 12:06:30 +0000</pubDate>
		<guid isPermaLink="false">http://thaylin.info/blog/?p=211#comment-136</guid>
		<description>Hi Thaylin,
I am a seasoned programmer but completely new to FlexBuilder. This &#039;JS injection&#039; looks great and I wanted to try it out. I imported your zip file into FlexBuilder - but apparently I need something else which activates it.
So the complete newbie&#039;s question: How do I use it?
Thanks for any additional info
Helmut</description>
		<content:encoded><![CDATA[<p>Hi Thaylin,<br />
I am a seasoned programmer but completely new to FlexBuilder. This &#8216;JS injection&#8217; looks great and I wanted to try it out. I imported your zip file into FlexBuilder &#8211; but apparently I need something else which activates it.<br />
So the complete newbie&#8217;s question: How do I use it?<br />
Thanks for any additional info<br />
Helmut</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thaylin</title>
		<link>http://www.thaylin.com/blog/2009/05/21/the-down-lo-on-externalinterface-and-javascript-injection-via-actionscript-3/comment-page-1/#comment-67</link>
		<dc:creator>Thaylin</dc:creator>
		<pubDate>Fri, 22 May 2009 03:15:53 +0000</pubDate>
		<guid isPermaLink="false">http://thaylin.info/blog/?p=211#comment-67</guid>
		<description>Actually yeah I spoke about that but did forget to include it in the example files as that part is with the facebook app I&#039;m working on. I did, however, talk about this on a previous blog post I made. In fact, it&#039;s the blog post just before this one. So if you go to the main page you&#039;ll see it. &lt;a href=&quot;http://thaylin.info/blog/2009/05/01/javascript-injection-via-as3-to-embed-external-libraries/&quot; rel=&quot;nofollow&quot;&gt;Or just click here.&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Actually yeah I spoke about that but did forget to include it in the example files as that part is with the facebook app I&#8217;m working on. I did, however, talk about this on a previous blog post I made. In fact, it&#8217;s the blog post just before this one. So if you go to the main page you&#8217;ll see it. <a href="http://thaylin.info/blog/2009/05/01/javascript-injection-via-as3-to-embed-external-libraries/" rel="nofollow">Or just click here.</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Hunt</title>
		<link>http://www.thaylin.com/blog/2009/05/21/the-down-lo-on-externalinterface-and-javascript-injection-via-actionscript-3/comment-page-1/#comment-66</link>
		<dc:creator>Andrew Hunt</dc:creator>
		<pubDate>Thu, 21 May 2009 20:03:55 +0000</pubDate>
		<guid isPermaLink="false">http://thaylin.info/blog/?p=211#comment-66</guid>
		<description>Yo, Thaylin! Sorry I could not make it, I really wanted to check this out.
Q: I understood, perhaps mistakenly, that you were going to talk about an approach for injecting a whole library from an external source, say http://blahblah.com/jquery.js into the page.
Did you talk about such an approach? I didn&#039;t see anything like that in the example files.
thx,
A.</description>
		<content:encoded><![CDATA[<p>Yo, Thaylin! Sorry I could not make it, I really wanted to check this out.<br />
Q: I understood, perhaps mistakenly, that you were going to talk about an approach for injecting a whole library from an external source, say <a href="http://blahblah.com/jquery.js" rel="nofollow">http://blahblah.com/jquery.js</a> into the page.<br />
Did you talk about such an approach? I didn&#8217;t see anything like that in the example files.<br />
thx,<br />
A.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
