<?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: Calling JavaScript functions from your Flex applications using the ExternalInterface API</title>
	<atom:link href="http://blog.flexexamples.com/2008/03/09/calling-javascript-functions-from-your-flex-applications-using-the-externalinterface-api/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com/2008/03/09/calling-javascript-functions-from-your-flex-applications-using-the-externalinterface-api/</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Mon, 13 Feb 2012 01:38:13 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Hasan</title>
		<link>http://blog.flexexamples.com/2008/03/09/calling-javascript-functions-from-your-flex-applications-using-the-externalinterface-api/comment-page-1/#comment-10152</link>
		<dc:creator>Hasan</dc:creator>
		<pubDate>Fri, 11 Nov 2011 07:54:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/03/09/calling-javascript-functions-from-your-flex-applications-using-the-externalinterface-api/#comment-10152</guid>
		<description>Hi..
Can I use this method to call google maps actionscript API</description>
		<content:encoded><![CDATA[<p>Hi..<br />
Can I use this method to call google maps actionscript API</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arun</title>
		<link>http://blog.flexexamples.com/2008/03/09/calling-javascript-functions-from-your-flex-applications-using-the-externalinterface-api/comment-page-1/#comment-9317</link>
		<dc:creator>Arun</dc:creator>
		<pubDate>Sat, 18 Jun 2011 10:10:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/03/09/calling-javascript-functions-from-your-flex-applications-using-the-externalinterface-api/#comment-9317</guid>
		<description>it was simple superb...with useful information...thnxs...</description>
		<content:encoded><![CDATA[<p>it was simple superb&#8230;with useful information&#8230;thnxs&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gokul</title>
		<link>http://blog.flexexamples.com/2008/03/09/calling-javascript-functions-from-your-flex-applications-using-the-externalinterface-api/comment-page-1/#comment-8976</link>
		<dc:creator>Gokul</dc:creator>
		<pubDate>Thu, 17 Feb 2011 01:19:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/03/09/calling-javascript-functions-from-your-flex-applications-using-the-externalinterface-api/#comment-8976</guid>
		<description>This (modifying index.template.html) works for me when I build and run within the Eclipse IDE. However, when I use ANT FlexTasks jar to build my application, the resulting index.html always seems to ignore any custom markup within the template. So I end up with an index.html which does not have any of the changes made to index.template.html for the javascript addition. Do you know what I might be needing to fix this.</description>
		<content:encoded><![CDATA[<p>This (modifying index.template.html) works for me when I build and run within the Eclipse IDE. However, when I use ANT FlexTasks jar to build my application, the resulting index.html always seems to ignore any custom markup within the template. So I end up with an index.html which does not have any of the changes made to index.template.html for the javascript addition. Do you know what I might be needing to fix this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aneesh PS</title>
		<link>http://blog.flexexamples.com/2008/03/09/calling-javascript-functions-from-your-flex-applications-using-the-externalinterface-api/comment-page-1/#comment-8322</link>
		<dc:creator>Aneesh PS</dc:creator>
		<pubDate>Tue, 14 Sep 2010 07:22:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/03/09/calling-javascript-functions-from-your-flex-applications-using-the-externalinterface-api/#comment-8322</guid>
		<description>Nice post.
Really usefull...............!</description>
		<content:encoded><![CDATA[<p>Nice post.<br />
Really usefull&#8230;&#8230;&#8230;&#8230;&#8230;!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jigisha</title>
		<link>http://blog.flexexamples.com/2008/03/09/calling-javascript-functions-from-your-flex-applications-using-the-externalinterface-api/comment-page-1/#comment-7197</link>
		<dc:creator>Jigisha</dc:creator>
		<pubDate>Tue, 09 Mar 2010 05:16:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/03/09/calling-javascript-functions-from-your-flex-applications-using-the-externalinterface-api/#comment-7197</guid>
		<description>Hi, 
Very nice article.
I have a Flex file and javascript is embeded as above.
 My requirement is to open FLex in PDF.
I have  opened this Flex in PDF document but Javascript is not working.

Can you please provide solution ASAP.

Thanks,
Jigisha</description>
		<content:encoded><![CDATA[<p>Hi,<br />
Very nice article.<br />
I have a Flex file and javascript is embeded as above.<br />
 My requirement is to open FLex in PDF.<br />
I have  opened this Flex in PDF document but Javascript is not working.</p>
<p>Can you please provide solution ASAP.</p>
<p>Thanks,<br />
Jigisha</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sami</title>
		<link>http://blog.flexexamples.com/2008/03/09/calling-javascript-functions-from-your-flex-applications-using-the-externalinterface-api/comment-page-1/#comment-6488</link>
		<dc:creator>sami</dc:creator>
		<pubDate>Sun, 29 Nov 2009 12:17:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/03/09/calling-javascript-functions-from-your-flex-applications-using-the-externalinterface-api/#comment-6488</guid>
		<description>Hi

The project in the view-source zip file doesn&#039;t work for me in FF 3.5 - works like a charm in IE6 - the strange thing is, the example embedded here works fine :S

I&#039;ve heard references of other people saying ExternalInterface not working on FF too - I have tried alot of tricks but it isn&#039;t working - any ideas?</description>
		<content:encoded><![CDATA[<p>Hi</p>
<p>The project in the view-source zip file doesn&#8217;t work for me in FF 3.5 &#8211; works like a charm in IE6 &#8211; the strange thing is, the example embedded here works fine :S</p>
<p>I&#8217;ve heard references of other people saying ExternalInterface not working on FF too &#8211; I have tried alot of tricks but it isn&#8217;t working &#8211; any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aurel Cortez</title>
		<link>http://blog.flexexamples.com/2008/03/09/calling-javascript-functions-from-your-flex-applications-using-the-externalinterface-api/comment-page-1/#comment-6376</link>
		<dc:creator>Aurel Cortez</dc:creator>
		<pubDate>Tue, 17 Nov 2009 08:36:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/03/09/calling-javascript-functions-from-your-flex-applications-using-the-externalinterface-api/#comment-6376</guid>
		<description>Hi there! I&#039;m using &lt;strong&gt;Flex Builder Version 3.0 (build 3.0.2.214193)&lt;/strong&gt; and it seems like the file &lt;strong&gt;index.template.html&lt;/strong&gt; is no longer in use.  Can you please enlighten me bout this.</description>
		<content:encoded><![CDATA[<p>Hi there! I&#8217;m using <strong>Flex Builder Version 3.0 (build 3.0.2.214193)</strong> and it seems like the file <strong>index.template.html</strong> is no longer in use.  Can you please enlighten me bout this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter deHaan</title>
		<link>http://blog.flexexamples.com/2008/03/09/calling-javascript-functions-from-your-flex-applications-using-the-externalinterface-api/comment-page-1/#comment-5955</link>
		<dc:creator>Peter deHaan</dc:creator>
		<pubDate>Thu, 08 Oct 2009 02:27:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/03/09/calling-javascript-functions-from-your-flex-applications-using-the-externalinterface-api/#comment-5955</guid>
		<description>@Blaine,

Perhaps this is a bit over-simplified, but maybe this will help:
&lt;pre lang=&quot;mxml&quot;&gt;
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; width=&quot;400&quot; height=&quot;300&quot;&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.controls.Alert;

            protected function callJavaScript():void {
                if (tree.selectedItem) {
                    var str:String = tree.selectedItem.@label;
                    ExternalInterface.call(&quot;alert&quot;, str);
                } else {
                    Alert.show(&quot;You dont have anything selected&quot;);
                }
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Tree id=&quot;tree&quot; labelField=&quot;@label&quot; width=&quot;200&quot;&gt;
        &lt;mx:dataProvider&gt;
            &lt;mx:XML xmlns=&quot;&quot;&gt;
                &lt;root label=&quot;Root&quot;&gt;
                    &lt;node label=&quot;1. One&quot; /&gt;
                    &lt;node label=&quot;2. Two&quot;&gt;
                        &lt;node label=&quot;2a. Two&quot; /&gt;
                        &lt;node label=&quot;2b. Two&quot; /&gt;
                        &lt;node label=&quot;2c. Two&quot; /&gt;
                        &lt;node label=&quot;2d. Two&quot; /&gt;
                    &lt;/node&gt;
                    &lt;node label=&quot;3. Three&quot; /&gt;
                    &lt;node label=&quot;4. Four&quot; /&gt;
                    &lt;node label=&quot;5. Five&quot; /&gt;
                    &lt;node label=&quot;6. Six&quot; /&gt;
                    &lt;node label=&quot;7. Seven&quot; /&gt;
                    &lt;node label=&quot;8. Eight&quot; /&gt;
                    &lt;node label=&quot;9. Nine&quot; /&gt;
                &lt;/root&gt;
            &lt;/mx:XML&gt;
        &lt;/mx:dataProvider&gt;
    &lt;/mx:Tree&gt;
    &lt;mx:Button label=&quot;Send Tree selected item to JavaScript&quot; click=&quot;callJavaScript();&quot; /&gt;

&lt;/mx:Application&gt;
&lt;/pre&gt;

Peter</description>
		<content:encoded><![CDATA[<p>@Blaine,</p>
<p>Perhaps this is a bit over-simplified, but maybe this will help:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> width=<span style="color: #ff0000;">&quot;400&quot;</span> height=<span style="color: #ff0000;">&quot;300&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #339933;">&lt;mx:Script&gt;</span>
<span style="color: #339933;">        &lt;![CDATA[</span>
<span style="color: #339933;">            import mx.controls.Alert;</span>
&nbsp;
<span style="color: #339933;">            protected function callJavaScript():void {</span>
<span style="color: #339933;">                if (tree.selectedItem) {</span>
<span style="color: #339933;">                    var str:String = tree.selectedItem.@label;</span>
<span style="color: #339933;">                    ExternalInterface.call(&quot;alert&quot;, str);</span>
<span style="color: #339933;">                } else {</span>
<span style="color: #339933;">                    Alert.show(&quot;You dont have anything selected&quot;);</span>
<span style="color: #339933;">                }</span>
<span style="color: #339933;">            }</span>
<span style="color: #339933;">        ]]&gt;</span>
<span style="color: #339933;">    &lt;/mx:Script&gt;</span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Tree</span> id=<span style="color: #ff0000;">&quot;tree&quot;</span> labelField=<span style="color: #ff0000;">&quot;@label&quot;</span> width=<span style="color: #ff0000;">&quot;200&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:XML</span> xmlns=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;">&lt;root label=<span style="color: #ff0000;">&quot;Root&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;1. One&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;2. Two&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;2a. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;2b. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;2c. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;2d. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;/node<span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;3. Three&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;4. Four&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;5. Five&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;6. Six&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;7. Seven&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;8. Eight&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;9. Nine&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;">&lt;/root<span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:XML</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Tree</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> label=<span style="color: #ff0000;">&quot;Send Tree selected item to JavaScript&quot;</span> click=<span style="color: #ff0000;">&quot;callJavaScript();&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Blaine</title>
		<link>http://blog.flexexamples.com/2008/03/09/calling-javascript-functions-from-your-flex-applications-using-the-externalinterface-api/comment-page-1/#comment-5946</link>
		<dc:creator>Blaine</dc:creator>
		<pubDate>Wed, 07 Oct 2009 01:58:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/03/09/calling-javascript-functions-from-your-flex-applications-using-the-externalinterface-api/#comment-5946</guid>
		<description>Hey Peter,

I have been trying to get a Flex Tree working with JavaScript and have had no luck. I ran the example you posted above and it works great. I also can send data from a datagrid to JavaScript. However, no matter what i try I cannot get a Tree to send its selected item to JavaScript. Can you give me any hints or do you have an example you can share? What I am trying to do is call a function in JavaScript and send it the label of the item selected in the tree. 

Cheers,

B</description>
		<content:encoded><![CDATA[<p>Hey Peter,</p>
<p>I have been trying to get a Flex Tree working with JavaScript and have had no luck. I ran the example you posted above and it works great. I also can send data from a datagrid to JavaScript. However, no matter what i try I cannot get a Tree to send its selected item to JavaScript. Can you give me any hints or do you have an example you can share? What I am trying to do is call a function in JavaScript and send it the label of the item selected in the tree. </p>
<p>Cheers,</p>
<p>B</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pramod</title>
		<link>http://blog.flexexamples.com/2008/03/09/calling-javascript-functions-from-your-flex-applications-using-the-externalinterface-api/comment-page-1/#comment-4955</link>
		<dc:creator>Pramod</dc:creator>
		<pubDate>Wed, 05 Aug 2009 08:47:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/03/09/calling-javascript-functions-from-your-flex-applications-using-the-externalinterface-api/#comment-4955</guid>
		<description>Hi,

It&#039;s really a good, lucid explaination here. Even the example is good. I liked it.

Thanks,
Pramod</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>It&#8217;s really a good, lucid explaination here. Even the example is good. I liked it.</p>
<p>Thanks,<br />
Pramod</p>
]]></content:encoded>
	</item>
</channel>
</rss>

