<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.1" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Returning values from JavaScript in your Flex applications using the ExternalInterface API</title>
	<link>http://blog.flexexamples.com/2008/03/11/returning-values-from-javascript-in-your-flex-applications-using-the-externalinterface-api/</link>
	<description>A bunch of examples for Adobe Flex and ActionScript</description>
	<pubDate>Fri, 05 Dec 2008 00:37:37 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.1</generator>

	<item>
		<title>By: nathan king</title>
		<link>http://blog.flexexamples.com/2008/03/11/returning-values-from-javascript-in-your-flex-applications-using-the-externalinterface-api/#comment-14313</link>
		<author>nathan king</author>
		<pubDate>Wed, 23 Jul 2008 17:38:33 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/03/11/returning-values-from-javascript-in-your-flex-applications-using-the-externalinterface-api/#comment-14313</guid>
		<description>found it - for anyone else looking - you have to register the javascript function and associate it with the internal flex function you wish to call using the following syntax within your flex app:

ExternalInterface.addCallback("jsFunctionName", flexFunctionName);

or just try searching this blog (duh), apologies.
http://blog.flexexamples.com/2008/03/11/calling-actionscript-functions-from-your-html-templates-using-the-externalinterface-api/</description>
		<content:encoded><![CDATA[<p>found it - for anyone else looking - you have to register the javascript function and associate it with the internal flex function you wish to call using the following syntax within your flex app:</p>
<p>ExternalInterface.addCallback(&#8221;jsFunctionName&#8221;, flexFunctionName);</p>
<p>or just try searching this blog (duh), apologies.<br />
<a href="http://blog.flexexamples.com/2008/03/11/calling-actionscript-functions-from-your-html-templates-using-the-externalinterface-api/" rel="nofollow">http://blog.flexexamples.com/2008/03/11/calling-actionscript-functions-from-your-html-templates-using-the-externalinterface-api/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nathan king</title>
		<link>http://blog.flexexamples.com/2008/03/11/returning-values-from-javascript-in-your-flex-applications-using-the-externalinterface-api/#comment-14311</link>
		<author>nathan king</author>
		<pubDate>Wed, 23 Jul 2008 15:30:24 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/03/11/returning-values-from-javascript-in-your-flex-applications-using-the-externalinterface-api/#comment-14311</guid>
		<description>poking around to find out if JS can make a call to a function inside a flex app without flex initiating the interaction. Thoughts?
Thank you so much forthe code examples,
-Nathan</description>
		<content:encoded><![CDATA[<p>poking around to find out if JS can make a call to a function inside a flex app without flex initiating the interaction. Thoughts?<br />
Thank you so much forthe code examples,<br />
-Nathan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peterd</title>
		<link>http://blog.flexexamples.com/2008/03/11/returning-values-from-javascript-in-your-flex-applications-using-the-externalinterface-api/#comment-7777</link>
		<author>peterd</author>
		<pubDate>Fri, 21 Mar 2008 23:38:52 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/03/11/returning-values-from-javascript-in-your-flex-applications-using-the-externalinterface-api/#comment-7777</guid>
		<description>MArcio,

If you're using the &lt;code&gt;creationComplete&lt;/code&gt; event, it may be a timing issue. With the ExternalInterface API there is never really a guarantee that the Flex app will complete before/after the HTML container its in.

What if you try using a timer and putting a delay of say, 2 seconds? (or 4 seconds).
If the code works in that scenario, I would guess its a simple timing issue and the HTML just isn't fully initialized yet.

Peter</description>
		<content:encoded><![CDATA[<p>MArcio,</p>
<p>If you&#8217;re using the <code>creationComplete</code> event, it may be a timing issue. With the ExternalInterface API there is never really a guarantee that the Flex app will complete before/after the HTML container its in.</p>
<p>What if you try using a timer and putting a delay of say, 2 seconds? (or 4 seconds).<br />
If the code works in that scenario, I would guess its a simple timing issue and the HTML just isn&#8217;t fully initialized yet.</p>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MArcio</title>
		<link>http://blog.flexexamples.com/2008/03/11/returning-values-from-javascript-in-your-flex-applications-using-the-externalinterface-api/#comment-7773</link>
		<author>MArcio</author>
		<pubDate>Fri, 21 Mar 2008 18:55:00 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/03/11/returning-values-from-javascript-in-your-flex-applications-using-the-externalinterface-api/#comment-7773</guid>
		<description>arr.appVersion: undefined

I'm usign on creationComplete of my mx:Application

&lt;pre class="code"&gt;
private function callJavaScript_BrowserInfo():void {
var keys:Array = "appCodeName,appName,appVersion,cookieEnabled,language,platform,systemLanguage,userAgent,userLanguage".split(",");
var arr:Array = ExternalInterface.call("getNavigatorObject", keys);
trace("arr.appVersion: " + arr.appVersion);
dataGrid.dataProvider = arr;
if (arr){
for (var i:int = 0; i 
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>arr.appVersion: undefined</p>
<p>I&#8217;m usign on creationComplete of my mx:Application</p>
<pre class="code">
private function callJavaScript_BrowserInfo():void {
var keys:Array = "appCodeName,appName,appVersion,cookieEnabled,language,platform,systemLanguage,userAgent,userLanguage".split(",");
var arr:Array = ExternalInterface.call("getNavigatorObject", keys);
trace("arr.appVersion: " + arr.appVersion);
dataGrid.dataProvider = arr;
if (arr){
for (var i:int = 0; i
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: peterd</title>
		<link>http://blog.flexexamples.com/2008/03/11/returning-values-from-javascript-in-your-flex-applications-using-the-externalinterface-api/#comment-7765</link>
		<author>peterd</author>
		<pubDate>Fri, 21 Mar 2008 16:29:23 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/03/11/returning-values-from-javascript-in-your-flex-applications-using-the-externalinterface-api/#comment-7765</guid>
		<description>MArcio,

Does calling &lt;code&gt;trace(arr.appVersion);&lt;/code&gt; work after calling &lt;code&gt;ExternalInterface.call()&lt;/code&gt;?

Peter</description>
		<content:encoded><![CDATA[<p>MArcio,</p>
<p>Does calling <code>trace(arr.appVersion);</code> work after calling <code>ExternalInterface.call()</code>?</p>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MArcio</title>
		<link>http://blog.flexexamples.com/2008/03/11/returning-values-from-javascript-in-your-flex-applications-using-the-externalinterface-api/#comment-7753</link>
		<author>MArcio</author>
		<pubDate>Fri, 21 Mar 2008 15:04:55 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/03/11/returning-values-from-javascript-in-your-flex-applications-using-the-externalinterface-api/#comment-7753</guid>
		<description>How to trace a value returned for example 

&lt;pre class="code"&gt;
private function callJavaScript():void {
var keys:Array = "appCodeName,appName,appVersion,cookieEnabled,language,platform,systemLanguage,userAgent,userLanguage".split(",");
var arr:Array = ExternalInterface.call("getNavigatorObject", keys);
for (var i:int = 0; i 
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>How to trace a value returned for example </p>
<pre class="code">
private function callJavaScript():void {
var keys:Array = "appCodeName,appName,appVersion,cookieEnabled,language,platform,systemLanguage,userAgent,userLanguage".split(",");
var arr:Array = ExternalInterface.call("getNavigatorObject", keys);
for (var i:int = 0; i
</pre>
]]></content:encoded>
	</item>
</channel>
</rss>
