<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>sample &#8211; stoimen&#039;s web log</title>
	<atom:link href="/tag/sample/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>on web development</description>
	<lastBuildDate>Tue, 13 Feb 2018 08:18:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.0.3</generator>
	<item>
		<title>Tiny ArcGIS javascript library</title>
		<link>/2009/09/04/tiny-arcgis-javascript-library/</link>
		<comments>/2009/09/04/tiny-arcgis-javascript-library/#respond</comments>
		<pubDate>Fri, 04 Sep 2009 06:20:14 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[arcgis]]></category>
		<category><![CDATA[gis]]></category>
		<category><![CDATA[sample]]></category>
		<category><![CDATA[tiny library]]></category>

		<guid isPermaLink="false">/?p=734</guid>
		<description><![CDATA[I recently wrote a small, very very small, javascript library using ArcGIS. It might be helpful for someone however. It&#8217;s really small and it can be extended easily. The code and the samples can be seen on http://stoimen.com/arcgis<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2009/03/19/jquery-ui/" rel="bookmark" title="JQuery UI">JQuery UI </a></li>
<li><a href="/2010/09/13/looping-animation-with-javascript-and-raphael/" rel="bookmark" title="Looping Animation with JavaScript and Raphaël">Looping Animation with JavaScript and Raphaël </a></li>
<li><a href="/2010/03/12/javascript-libraries-popularity/" rel="bookmark" title="Javascript Libraries Popularity">Javascript Libraries Popularity </a></li>
<li><a href="/2009/03/09/flex-javascript-communcation-example/" rel="bookmark" title="Flex Javascript communcation example">Flex Javascript communcation example </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>I recently wrote a small, very very small, javascript library using ArcGIS. It might be helpful for someone however.</p>
<p><a href="/wp-content/uploads/2009/09/arcgis-js-library-sample.png"><img class="aligncenter size-full wp-image-735" title="arcgis-js-library-sample" src="/wp-content/uploads/2009/09/arcgis-js-library-sample.png" alt="" width="430" height="224" srcset="/wp-content/uploads/2009/09/arcgis-js-library-sample.png 430w, /wp-content/uploads/2009/09/arcgis-js-library-sample-300x156.png 300w" sizes="(max-width: 430px) 100vw, 430px" /></a></p>
<p>It&#8217;s really small and it can be extended easily.</p>
<p><a href="/wp-content/uploads/2009/09/javascript-arcgis-code-shot.png"><img class="aligncenter size-full wp-image-736" title="javascript-arcgis-code-shot" src="/wp-content/uploads/2009/09/javascript-arcgis-code-shot.png" alt="" width="430" height="247" srcset="/wp-content/uploads/2009/09/javascript-arcgis-code-shot.png 430w, /wp-content/uploads/2009/09/javascript-arcgis-code-shot-300x172.png 300w" sizes="(max-width: 430px) 100vw, 430px" /></a></p>
<p>The <a title="arcgis javascript code" href="http://stoimen.com/arcgis/arcgis.js" target="_blank">code</a> and the samples can be seen on <a href="http://stoimen.com/arcgis" target="_blank">http://stoimen.com/arcgis</a></p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2009/03/19/jquery-ui/" rel="bookmark" title="JQuery UI">JQuery UI </a></li>
<li><a href="/2010/09/13/looping-animation-with-javascript-and-raphael/" rel="bookmark" title="Looping Animation with JavaScript and Raphaël">Looping Animation with JavaScript and Raphaël </a></li>
<li><a href="/2010/03/12/javascript-libraries-popularity/" rel="bookmark" title="Javascript Libraries Popularity">Javascript Libraries Popularity </a></li>
<li><a href="/2009/03/09/flex-javascript-communcation-example/" rel="bookmark" title="Flex Javascript communcation example">Flex Javascript communcation example </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2009/09/04/tiny-arcgis-javascript-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex Javascript communcation example</title>
		<link>/2009/03/09/flex-javascript-communcation-example/</link>
		<comments>/2009/03/09/flex-javascript-communcation-example/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 06:59:29 +0000</pubDate>
		<dc:creator><![CDATA[stoimen]]></dc:creator>
				<category><![CDATA[featured]]></category>
		<category><![CDATA[flex 3]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[communication]]></category>
		<category><![CDATA[ExternalInterface]]></category>
		<category><![CDATA[sample]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">/?p=305</guid>
		<description><![CDATA[Here's a short sample, showing how to set up communication between JavaScript and Flex.<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2009/03/07/flex-javascript-communication/" rel="bookmark" title="Flex Javascript communication">Flex Javascript communication </a></li>
<li><a href="/2009/10/29/passing-objects-with-externalinterface-from-js-to-flex/" rel="bookmark" title="Passing objects with ExternalInterface from JS to Flex">Passing objects with ExternalInterface from JS to Flex </a></li>
<li><a href="/2009/07/08/externalinterface-from-javascript-to-ie-firefox/" rel="bookmark" title="ExternalInterface from JavaScript to IE/Firefox">ExternalInterface from JavaScript to IE/Firefox </a></li>
<li><a href="/2011/07/28/oop-javascript-accessing-public-methods-in-private-methods/" rel="bookmark" title="OOP JavaScript: Accessing Public Methods in Private Methods">OOP JavaScript: Accessing Public Methods in Private Methods </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>First of all you&#8217;ve to have both files for JavaScript and Actionscript  3 to make the communication successful. I don&#8217;t remember where exactly I found the tutorial, maybe it was on the official Adobe&#8217;s documentation page, but as I&#8217;ve <a title="javascript to flex communcation with externalInterface" href="/2009/03/07/flex-javascript-communication/" target="_self">written</a> before I&#8217;m going to share my experience with the ExternalInterface options of Flex.</p>
<p>First of all you&#8217;ve to add this at the beginning of the page with the simple js code:</p>
<blockquote><p><span style="color: #808080;"><em>var jsReady = false;<br />
function isReady()<br />
{<br />
return jsReady;<br />
}</em></span></p>
<p><em>function pageInit()<br />
{<br />
jsReady = true;<br />
}</em></p></blockquote>
<p>of course the <strong>pageInit()</strong> function should be called <em><strong>onload</strong></em> of the body. It simply sets the JavaScript part to be ready for communication, after initialize the page. Than a small part of the javascript should be written for really speaking with the Flex application.</p>
<blockquote><p><span style="color: #808080;"><em>var swfReady = false;</em></span></p>
<p><em>function setSWFIsReady() {<br />
swfReady = true;<br />
}</em></p>
<p><em>function getSWF(movieName) {<br />
if (navigator.appName.indexOf(&#8220;Microsoft&#8221;) != -1) {<br />
return window[movieName];<br />
} else {<br />
return document[movieName];<br />
}<br />
}</em></p>
<p><em>function callFlexApp() {<br />
if (swfReady) {<br />
getSWF(&#8220;flash_movie&#8221;).methodInFlex(param_value1, param_value2);<br />
}<br />
}</em></p></blockquote>
<p>Where <em><strong>flash_movie</strong></em> is the id of the object / embed pair.</p>
<p>First of all the JavaScript can begin to call methods in Flex only after the Flex application has returned that it has been initialized. That happens in Flex within the following file:</p>
<blockquote><p><span style="color: #808080;"><em>package communicator {</em></span></p>
<p><em>import flash.events.TimerEvent;<br />
import flash.external.*;<br />
import flash.utils.Timer;</em></p>
<p><em>public class Communicator<br />
{</em></p>
<p><em>public function init():void {</em></p>
<p><em>if (ExternalInterface.available)<br />
{</em></p>
<p><em>var containerReady:Boolean = isContainerReady();<br />
if (containerReady)<br />
{<br />
setupCallbacks();<br />
}<br />
else<br />
{<br />
var readyTimer:Timer = new Timer(100);<br />
readyTimer.addEventListener(TimerEvent.TIMER, timerHandler);<br />
readyTimer.start();<br />
}</em></p>
<p><em>}<br />
else<br />
{<br />
trace(&#8220;External interface is not available for this container.&#8221;);<br />
}</em></p>
<p><em>}</em></p>
<p><em>private function isContainerReady():Boolean<br />
{<br />
var result:Boolean = ExternalInterface.call(&#8220;isReady&#8221;);<br />
return result;<br />
}</em></p>
<p><em>private function setupCallbacks():void<br />
{<br />
ExternalInterface.addCallback(&#8220;callFlexApp&#8221;, callFlexApp);<br />
ExternalInterface.call(&#8220;setSWFIsReady&#8221;);<br />
}</em></p>
<p><em>private function timerHandler(event:TimerEvent):void<br />
{<br />
var isReady:Boolean = isContainerReady();<br />
if (isReady)<br />
{<br />
Timer(event.target).stop();<br />
setupCallbacks();<br />
}</em></p>
<p><em>}<br />
</em></p>
<p><span style="color: #808080;"><em><br />
private function callFlexApp(param1:int, param2:int):void<br />
{<br />
// this function is called from javascript</em></span></p>
<p><span style="color: #808080;"><em> }</em></span></p>
<p><em>}</em></p>
<p><em>}</em></p></blockquote>
<p>That&#8217;s the short description how to set up a communcation between JavaScript and Flex.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2009/03/07/flex-javascript-communication/" rel="bookmark" title="Flex Javascript communication">Flex Javascript communication </a></li>
<li><a href="/2009/10/29/passing-objects-with-externalinterface-from-js-to-flex/" rel="bookmark" title="Passing objects with ExternalInterface from JS to Flex">Passing objects with ExternalInterface from JS to Flex </a></li>
<li><a href="/2009/07/08/externalinterface-from-javascript-to-ie-firefox/" rel="bookmark" title="ExternalInterface from JavaScript to IE/Firefox">ExternalInterface from JavaScript to IE/Firefox </a></li>
<li><a href="/2011/07/28/oop-javascript-accessing-public-methods-in-private-methods/" rel="bookmark" title="OOP JavaScript: Accessing Public Methods in Private Methods">OOP JavaScript: Accessing Public Methods in Private Methods </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2009/03/09/flex-javascript-communcation-example/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Flex 3 Custom Preloader Download</title>
		<link>/2009/03/04/flex-3-custom-preloader-download/</link>
		<comments>/2009/03/04/flex-3-custom-preloader-download/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 05:48:45 +0000</pubDate>
		<dc:creator><![CDATA[stoimen]]></dc:creator>
				<category><![CDATA[download]]></category>
		<category><![CDATA[flex 3]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[preloader]]></category>
		<category><![CDATA[sample]]></category>

		<guid isPermaLink="false">/?p=265</guid>
		<description><![CDATA[download the custom preloader with centered preloader swf<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2009/02/06/flex-3-custom-preloader/" rel="bookmark" title="Flex 3 Custom Preloader">Flex 3 Custom Preloader </a></li>
<li><a href="/2009/03/01/download-custom-flex-3-datechooser-2/" rel="bookmark" title="Download Custom Flex 3 DateChooser">Download Custom Flex 3 DateChooser </a></li>
<li><a href="/2009/03/01/flex-3-custom-datechooser-2/" rel="bookmark" title="Flex 3 Custom DateChooser">Flex 3 Custom DateChooser </a></li>
<li><a href="/2009/03/15/download-flex-3-bitmap-with-round-corners/" rel="bookmark" title="Download Flex 3 bitmap with round corners">Download Flex 3 bitmap with round corners </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Finally managed to put a sample with source!</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="32" height="32" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="name" value="map" /><param name="bgcolor" value="#ffffff" /><param name="align" value="middle" /><param name="src" value="/wp-content/uploads/2009/03/preloader.swf" /><param name="wmode" value="transparent" /><embed type="application/x-shockwave-flash" width="32" height="32" src="/wp-content/uploads/2009/03/preloader.swf" wmode="transparent" align="middle" bgcolor="#ffffff" name="map"></embed></object></p>
<p><a title="download flex 3 custom preloader" href="/wp-content/uploads/2009/03/preloader.zip">download</a></p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2009/02/06/flex-3-custom-preloader/" rel="bookmark" title="Flex 3 Custom Preloader">Flex 3 Custom Preloader </a></li>
<li><a href="/2009/03/01/download-custom-flex-3-datechooser-2/" rel="bookmark" title="Download Custom Flex 3 DateChooser">Download Custom Flex 3 DateChooser </a></li>
<li><a href="/2009/03/01/flex-3-custom-datechooser-2/" rel="bookmark" title="Flex 3 Custom DateChooser">Flex 3 Custom DateChooser </a></li>
<li><a href="/2009/03/15/download-flex-3-bitmap-with-round-corners/" rel="bookmark" title="Download Flex 3 bitmap with round corners">Download Flex 3 bitmap with round corners </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2009/03/04/flex-3-custom-preloader-download/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
