<?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"
	>

<channel>
	<title>flex code monkey</title>
	<atom:link href="http://www.flexcodemonkey.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.flexcodemonkey.com/blog</link>
	<description>monkey see monkey code</description>
	<pubDate>Wed, 21 Apr 2010 14:27:24 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.5</generator>
	<language>en</language>
			<item>
		<title>Auto Localizer - Now with a Trusted Certificate</title>
		<link>http://www.flexcodemonkey.com/blog/?p=157</link>
		<comments>http://www.flexcodemonkey.com/blog/?p=157#comments</comments>
		<pubDate>Wed, 21 Apr 2010 14:27:24 +0000</pubDate>
		<dc:creator>skijunkie</dc:creator>
		
		<category><![CDATA[AIR]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[Adobe AIR]]></category>

		<category><![CDATA[Development]]></category>

		<category><![CDATA[Google]]></category>

		<category><![CDATA[I18N]]></category>

		<category><![CDATA[L10N]]></category>

		<category><![CDATA[Localization]]></category>

		<category><![CDATA[Translate]]></category>

		<category><![CDATA[Translation]]></category>

		<guid isPermaLink="false">http://www.flexcodemonkey.com/blog/?p=157</guid>
		<description><![CDATA[The Auto Localizer, an AIR application I wrote that uses the Google Translate service to auto translate properties files, is now signed with a trusted certificate on the Adobe AIR marketplace. Many thanks to Adobe for generously providing the certificate.
Auto Localizer blog post
Auto Localizer on the Adobe AIR marketplace
]]></description>
			<content:encoded><![CDATA[<p>The Auto Localizer, an AIR application I wrote that uses the Google Translate service to auto translate properties files, is now signed with a trusted certificate on the Adobe AIR marketplace. Many thanks to Adobe for generously providing the certificate.</p>
<p><a href="http://www.flexcodemonkey.com/blog/?p=132">Auto Localizer blog post</a></p>
<p><a href="http://www.adobe.com/cfusion/marketplace/index.cfm?event=marketplace.offering&#038;offeringid=17782&#038;marketplaceid=1">Auto Localizer on the Adobe AIR marketplace</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexcodemonkey.com/blog/?feed=rss2&amp;p=157</wfw:commentRss>
		</item>
		<item>
		<title>Auto Localizer - FREE on Adobe AIR Marketplace</title>
		<link>http://www.flexcodemonkey.com/blog/?p=150</link>
		<comments>http://www.flexcodemonkey.com/blog/?p=150#comments</comments>
		<pubDate>Thu, 08 Apr 2010 15:05:42 +0000</pubDate>
		<dc:creator>skijunkie</dc:creator>
		
		<category><![CDATA[AIR]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[Adobe AIR]]></category>

		<category><![CDATA[Development]]></category>

		<category><![CDATA[Google]]></category>

		<category><![CDATA[I18N]]></category>

		<category><![CDATA[L10N]]></category>

		<category><![CDATA[Localization]]></category>

		<category><![CDATA[Translate]]></category>

		<category><![CDATA[Translation]]></category>

		<guid isPermaLink="false">http://www.flexcodemonkey.com/blog/?p=150</guid>
		<description><![CDATA[The Auto Localizer, an AIR application I wrote that uses the Google Translate service to auto translate properties files, is now available free on the Adobe AIR marketplace.
Auto Localizer blog post
Auto Localizer on the Adobe AIR marketplace

]]></description>
			<content:encoded><![CDATA[<p>The Auto Localizer, an AIR application I wrote that uses the Google Translate service to auto translate properties files, is now available free on the Adobe AIR marketplace.</p>
<p><a href="http://www.flexcodemonkey.com/blog/?p=132">Auto Localizer blog post</a></p>
<p><a href="http://www.adobe.com/cfusion/marketplace/index.cfm?event=marketplace.offering&#038;offeringid=17782&#038;marketplaceid=1">Auto Localizer on the Adobe AIR marketplace</a></p>
<p><a href="http://flexcodemonkey.com/blog/wp-content/uploads/flex/autolocalizer/help/Auto_Localizer_Help_files/AutoLocalizer.png"><img src="http://flexcodemonkey.com/blog/wp-content/uploads/flex/autolocalizer/help/Auto_Localizer_Help_files/AutoLocalizer.png" alt="Auto Localizer Screenshot" width="680" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexcodemonkey.com/blog/?feed=rss2&amp;p=150</wfw:commentRss>
		</item>
		<item>
		<title>Auto Localizer - A Language Translation AIR Application</title>
		<link>http://www.flexcodemonkey.com/blog/?p=132</link>
		<comments>http://www.flexcodemonkey.com/blog/?p=132#comments</comments>
		<pubDate>Wed, 31 Mar 2010 18:11:44 +0000</pubDate>
		<dc:creator>skijunkie</dc:creator>
		
		<category><![CDATA[AIR]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[Adobe AIR]]></category>

		<category><![CDATA[Development]]></category>

		<category><![CDATA[Google Translate]]></category>

		<category><![CDATA[I18N]]></category>

		<category><![CDATA[L10N]]></category>

		<category><![CDATA[Localization]]></category>

		<category><![CDATA[Translation]]></category>

		<guid isPermaLink="false">http://www.flexcodemonkey.com/blog/?p=132</guid>
		<description><![CDATA[Auto Localizer is an AIR application I wrote that uses the Google Translate service to auto translate properties files. I deal with localization in enterprise applications every day. My company spends a good amount of money to outsource the localization of our enterprise applications. While Google Translate is not robust enough for an enterprise application [...]]]></description>
			<content:encoded><![CDATA[<p>Auto Localizer is an AIR application I wrote that uses the Google Translate service to auto translate properties files. I deal with localization in enterprise applications every day. My company spends a good amount of money to outsource the localization of our enterprise applications. While Google Translate is not robust enough for an enterprise application it can definitely be useful for small budget, open source, and pet project applications.</p>
<p>I did not spend a whole lot of time polishing the UI for this application as it is really just a utility for developers. I already know of a few places that can use some more development to increase usability, so I went ahead and used the AIR update APIs to check for and install any updates I make to this application. Feel free to let me know what you think and what improvements can be made. Of course I cannot improve the quality of the translations that come from the Google Translate service, but everything else is fair game.</p>
<p><a href="http://flexcodemonkey.com/blog/wp-content/uploads/flex/autolocalizer/AutoLocalizer.air">Install the Auto Localizer application.</a></p>
<p><a href="http://flexcodemonkey.com/blog/wp-content/uploads/flex/autolocalizer/help/Auto_Localizer_Help.html">Instructions on using the Auto Localizer application.</a></p>
<p><a href="http://flexcodemonkey.com/blog/wp-content/uploads/flex/autolocalizer/help/Auto_Localizer_Help_files/AutoLocalizer.png"><img src="http://flexcodemonkey.com/blog/wp-content/uploads/flex/autolocalizer/help/Auto_Localizer_Help_files/AutoLocalizer.png" alt="Auto Localizer Screenshot" width="680" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexcodemonkey.com/blog/?feed=rss2&amp;p=132</wfw:commentRss>
		</item>
		<item>
		<title>Flash on the iPhone&#8230;sorta</title>
		<link>http://www.flexcodemonkey.com/blog/?p=129</link>
		<comments>http://www.flexcodemonkey.com/blog/?p=129#comments</comments>
		<pubDate>Tue, 06 Oct 2009 16:46:31 +0000</pubDate>
		<dc:creator>skijunkie</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.flexcodemonkey.com/blog/?p=129</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p><html><center><br /><object width="500" height="315"><param name="movie" value="http://www.youtube.com/v/rebv7iXKufw&amp;hl=en&amp;fs=1&amp;rel=0&amp;color1=0x006699&amp;color2=0x54abd6&amp;border=1"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/rebv7iXKufw&amp;hl=en&amp;fs=1&amp;rel=0&amp;color1=0x006699&amp;color2=0x54abd6&amp;border=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="500" height="315"></embed></object><br /></center></html></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexcodemonkey.com/blog/?feed=rss2&amp;p=129</wfw:commentRss>
		</item>
		<item>
		<title>Enterprise Flex: Modules - Using Intefaces to Communicate</title>
		<link>http://www.flexcodemonkey.com/blog/?p=55</link>
		<comments>http://www.flexcodemonkey.com/blog/?p=55#comments</comments>
		<pubDate>Wed, 10 Jun 2009 15:55:33 +0000</pubDate>
		<dc:creator>skijunkie</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<category><![CDATA[Development]]></category>

		<category><![CDATA[Modules]]></category>

		<guid isPermaLink="false">http://www.flexcodemonkey.com/blog/?p=55</guid>
		<description><![CDATA[My last post  involved turning an existing sample application into a module. Let&#8217;s build a little bit upon that example. Its nice to now have a module that I can load inside another Flex application, but what if we want the application to be able to communicate with this loaded module? We also don&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>My <a href="http://www.flexcodemonkey.com/blog/?p=50">last post</a>  involved turning an existing sample application into a module. Let&#8217;s build a little bit upon that example. Its nice to now have a module that I can load inside another Flex application, but what if we want the application to be able to communicate with this loaded module? We also don&#8217;t want to have a hard dependency between our application and the module since we want our module to have the ability to work inside any Flex application. </p>
<p>The answer is Interfaces. By defining a common interface for our modules and using it in both our application and our module we can easily allow our application to use any module methods exposed by the interface and avoid tight coupling.</p>
<p>Once again I will borrow from my <a href="http://www.flexcodemonkey.com/blog/?p=50">previous post</a> and add an interface to my FirstTry Application. Below is the interface I will be using (filename &#8220;IModule.as&#8221;):<br />
<font COLOR="#4800FF" POINT-SIZE="8"><code>package modules<br />
{<br />
import flash.events.IEventDispatcher;<br />
public interface IModule extends IEventDispatcher<br />
{<br />
    //expand the app (same as mouse over)<br />
    function expand():void;<br />
    //collapse the app<br />
    function collapse():void;<br />
    //click CRT button<br />
    function showCRT():void;<br />
    //click Flat panel button<br />
    function showFlatPanel():void;<br />
    //click Rear Proj button<br />
    function showRearProjection():void;<br />
    //click Front Proj button<br />
    function showFrontProjection():void;<br />
    //Pass in a yes/no question for the module to ask with an Alert.<br />
    //The alert will call back into your provided function<br />
    function askQuestion(question:String, alertCloseListener:Function):void;<br />
}<br />
}</code></font></p>
<p>In the module we need to implement this interface. To do that we add an implements tag at the top of the module like so:<br />
<font COLOR="#4800FF" POINT-SIZE="8">&lt;mx:Module xmlns:mx=&#8221;http://www.adobe.com/2006/mxml&#8221;<br />
implements=&#8221;modules.IModule&#8221; &gt;<br />
&lt;/mx:Module&gt;</code></font></p>
<p>At this point you would get compile errors telling you that the functions in the IModule interface do not have implementation methods. I won&#8217;t go into the individual method implementations here but you can refer to the complete source to see them in the sample project below. </p>
<p>Once the IModule implementation methods are done we are finished with the module and can move on to the Application that will be calling into the module.</p>
<p>In your application you first need to import the IModule interface:<br />
<font COLOR="#4800FF" POINT-SIZE="8">import modules.IModule;</code></font></p>
<p>Once you have your module loaded you can test to see if it implements the module interface:<br />
<font COLOR="#4800FF" POINT-SIZE="8">module = info.factory.create() as UIComponent;<br />
if (module != null) {<br />
//If the loaded module implements the known interface we can make calls into this module.<br />
if (module is IModule) {<br />
IModule(module).expand();<br />
}<br />
}</code></font></p>
<p>As you can see using interfaces with modules is pretty simple once you understand how it works. I&#8217;ll leave it to you to browse the source to see the various interface calls in action. Below is the updated Module Loader application with source enabled.</p>
<p><iframe src="http://www.flexcodemonkey.com/blog/wp-content/uploads/flex/moduleloader2/ModuleLoader.html" width="100%" height="565"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexcodemonkey.com/blog/?feed=rss2&amp;p=55</wfw:commentRss>
		</item>
		<item>
		<title>Enterprise Flex: How to bludgeon a Flex Application into a Flex Module</title>
		<link>http://www.flexcodemonkey.com/blog/?p=50</link>
		<comments>http://www.flexcodemonkey.com/blog/?p=50#comments</comments>
		<pubDate>Wed, 25 Mar 2009 15:42:48 +0000</pubDate>
		<dc:creator>skijunkie</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<category><![CDATA[Development]]></category>

		<category><![CDATA[Enterprise]]></category>

		<category><![CDATA[Modules]]></category>

		<guid isPermaLink="false">http://www.flexcodemonkey.com/blog/?p=50</guid>
		<description><![CDATA[Look at the top and very bottom of the main mxml file of your flex application. You should see opening and closing application statements very similar to this:

&#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" &#62;
&#60;/mx:Application&#62;

Now change the two instances of &#8220;mx:Application&#8221; to &#8220;mx:Module&#8221; like so:

&#60;mx:Module xmlns:mx="http://www.adobe.com/2006/mxml" &#62;
&#60;/mx:Module&#62;

Recompile your project. You are done! You now have a module SWF file. Much [...]]]></description>
			<content:encoded><![CDATA[<p>Look at the top and very bottom of the main mxml file of your flex application. You should see opening and closing application statements very similar to this:<br />
<font COLOR="#4800FF"><code><br />
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" &gt;<br />
&lt;/mx:Application&gt;<br />
</code></font></p>
<p>Now change the two instances of &#8220;mx:Application&#8221; to &#8220;mx:Module&#8221; like so:<br />
<font COLOR="#4800FF"><code><br />
&lt;mx:Module xmlns:mx="http://www.adobe.com/2006/mxml" &gt;<br />
&lt;/mx:Module&gt;<br />
</code></font></p>
<p>Recompile your project. You are done! You now have a module SWF file. Much simpler than the title implied right? Well stopping here wouldn&#8217;t be much of a post, but don&#8217;t worry I have something more interesting to add.</p>
<p>A large part of the enterprise project I&#8217;ve been working on for the past two years has been dealing with modules. In this post I&#8217;ll show how to load and unload your newly compiled module dynamically into another Flex application with a progress bar.</p>
<p>You cannot tell the difference between an application SWF and a module SWF just by looking at the file. If you try to run a module SWF as you would a application SWF you will just get a blank screen with the default flex background. Compiled Flex modules can only be used by loading them into a Flex application.</p>
<p>Borrowing from a <a href="http://www.flexcodemonkey.com/blog/?p=40">previous post</a>, I&#8217;ve recompiled my FirstTry application into a module and will use it in an application to demonstrate loading and unloading modules.</p>
<p>There are two ways to load modules, using mx:ModuleLoader and using mx:ModuleManager.  ModuleLoader is easier and quicker, but ModuleManager provides greater control over your module loading.</p>
<p>Loading a module with ModuleLoader can be as simple as adding this mxml line to your application:<br />
<font COLOR="#4800FF"><code>&lt;mx:ModuleLoader id="myModule" url="MyModule.swf" /&gt;</code></font><br />
This loads, instantiates, and adds the module to your UI all in one step. It is used in your mxml just like any other component tag (such as mx:VBox, mx:Canvas, etc.).</p>
<p>My sample project will concentrate on using the more flexible mx:ModuleManager. With ModuleManager you can download the module without immediately adding it to the UI. You can also instantiate multiple instances of a module if you have the need. There is only one method of interest for us on ModuleManager called &#8220;getModule&#8221; that returns an mx.modules.IModuleInfo object.<br />
<font COLOR="#4800FF"><code>var info:IModuleInfo = ModuleManager.getModule(moduleURL);</code></font></p>
<p>This call does not actually load the module yet. The IModuleInfo object is what we will use to load and instantiate the module and track the loading progress.</p>
<p>You can very easily show loading progress using a mx.controls.ProgressBar. All you need to do is set the source of the progressbar to be the IModuleInfo object like this:<br />
<font COLOR="#4800FF"><code> var pb:ProgressBar = new ProgressBar();<br />pb.source = info;</code></font><br />
Now the progressbar control will dynamically update with the loading progress of the module.</p>
<p>To actually start the loading of the module we need to call &#8220;load&#8221; on the IModuleInfo object. We need to add a couple of event listeners for listen for complete and possible error events.<br />
<font COLOR="#4800FF"><code>info.addEventListener(ModuleEvent.READY, modEventHandler);<br />info.addEventListener(ModuleEvent.ERROR, modErrorHandler);<br />info.load();</code></font></p>
<p>Once we get our READY event we still need to create an instance of the module and add it to our UI. We create an instance by using the factory in the IModuleInfo object. After that we merely need to add it to the UI.<br />
<font COLOR="#4800FF"><code>var module:UIComponent = info.factory.create() as UIComponent;<br />moduleContainer.addChild(module);</code></font></p>
<p>We create it as a UIComponent so that our application does not need to know exactly what the module is to use it. In future post I will show how you can create and implement Interfaces that allow two way interaction between the module and the container application.</p>
<p>If your application ever decides it is finished with a module it can unload it. Using the same IModuleInfo object you can call &#8220;unload&#8221; and listen for the UNLOAD complete event for any cleanup.<br />
<font COLOR="#4800FF"><code>info.addEventListener(ModuleEvent.UNLOAD, unloadEventHandler);<br />info.unload();</code></font></p>
<p>In future posts I will also go into how you can reduce the compiled size of your module SWF files when you know they will always be loaded by a specific application.</p>
<p>Below I have included a sample application that loads and unloads my FirstTryModule. The application itself only has two buttons: a load button and an unload button. Clicking the load button will load the module while displaying a progressbar and then add it to the UI. Source is enabled on this project so take look to see how all the code snippets above fit together.</p>
<p><iframe src="http://www.flexcodemonkey.com/blog/wp-content/uploads/flex/moduleloader1/ModuleLoader.html" width="100%" height="485"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexcodemonkey.com/blog/?feed=rss2&amp;p=50</wfw:commentRss>
		</item>
		<item>
		<title>Special Pricing for Adobe User Group Members</title>
		<link>http://www.flexcodemonkey.com/blog/?p=74</link>
		<comments>http://www.flexcodemonkey.com/blog/?p=74#comments</comments>
		<pubDate>Tue, 17 Feb 2009 22:14:16 +0000</pubDate>
		<dc:creator>skijunkie</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<category><![CDATA[Adobe]]></category>

		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.flexcodemonkey.com/blog/?p=74</guid>
		<description><![CDATA[Adobe has generously announced it will be offering a one time discount of 20% on a single order of any Adobe software through their North American store. From what I understand that single order can contain multiple pieces of software. You just need to be a member of an Adobe User Group. Contact your Adobe [...]]]></description>
			<content:encoded><![CDATA[<p>Adobe has generously announced it will be offering a one time discount of 20% on a single order of any Adobe software through their North American store. From what I understand that single order can contain multiple pieces of software. You just need to be a member of an Adobe User Group. Contact your Adobe User Group manager for your member number.</p>
<p><a href="http://www.adobeinfo.com/storecodes/cspartners">Details Here</a></p>
<p>This is a limited time offer good between February 9, 2009 through March 2, 2009.<br />
Could be a good time to buy if you have been sitting on the fence.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexcodemonkey.com/blog/?feed=rss2&amp;p=74</wfw:commentRss>
		</item>
		<item>
		<title>Adobe AIR 1.5 on Linux</title>
		<link>http://www.flexcodemonkey.com/blog/?p=71</link>
		<comments>http://www.flexcodemonkey.com/blog/?p=71#comments</comments>
		<pubDate>Tue, 20 Jan 2009 16:26:41 +0000</pubDate>
		<dc:creator>skijunkie</dc:creator>
		
		<category><![CDATA[AIR]]></category>

		<category><![CDATA[Development]]></category>

		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.flexcodemonkey.com/blog/?p=71</guid>
		<description><![CDATA[Adobe AIR 1.5 is now available on Linux. That&#8217;s good news for a project I am working on. Go try it out.
Adobe AIR 1.5
]]></description>
			<content:encoded><![CDATA[<p>Adobe AIR 1.5 is now available on Linux. That&#8217;s good news for a project I am working on. Go try it out.</p>
<p><a href="http://get.adobe.com/air/otherversions/">Adobe AIR 1.5</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexcodemonkey.com/blog/?feed=rss2&amp;p=71</wfw:commentRss>
		</item>
		<item>
		<title>How I became a Flex Addict - Part 2</title>
		<link>http://www.flexcodemonkey.com/blog/?p=40</link>
		<comments>http://www.flexcodemonkey.com/blog/?p=40#comments</comments>
		<pubDate>Wed, 07 Jan 2009 16:03:25 +0000</pubDate>
		<dc:creator>skijunkie</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.flexcodemonkey.com/blog/?p=40</guid>
		<description><![CDATA[Sorry this took me longer than expected. I had a busy holiday season with lots of family house guests. As promised I&#8217;ve recompiled my first project in Flex 3 with view source enabled. I&#8217;ve added the new project to the bottom of this post. 
Let me first give credit to the reflection component (Reflection.as) and [...]]]></description>
			<content:encoded><![CDATA[<p>Sorry this took me longer than expected. I had a busy holiday season with lots of family house guests. As promised I&#8217;ve recompiled my first project in Flex 3 with view source enabled. I&#8217;ve added the new project to the bottom of this post. </p>
<p>Let me first give credit to the reflection component (Reflection.as) and the moving tooltip (FXCTooltip.as). The reflection component was written by <a href="http://blog.benstucki.net">Ben Stucki</a> and the tooltip component was written by <a href="http://labs.flexcoders.nl">Maikel Sibbald</a>.</p>
<p>Looking at the code you can see my first application didn&#8217;t produce the cleanest code as I was learning and hacking around anything I didn&#8217;t quite understand yet. You&#8217;ll notice the door transition is not really a true reusable effect. Instead it is a set of two containers with images that I manually slide open and closed with parallel effects.</p>
<p>One interesting revelation in writing this application was that there is no animated GIF support built into Flex. At the time I was a little annoyed having been used to it being available in Java for years. That broke my idea of using an animated GIF for the little moving gears on the left sliding door. I now know you typically embed a Flash SWF animation for situations like this, but I don&#8217;t have Flash Professional so converting my animated GIF was not an option.</p>
<p>My hack solution is found in &#8220;components/AnimateImage.mxml&#8221;. Basically I extended mx:Canvas and stacked all the frames of my animated GIF in separate mx:Image components. At any given render only one of these images is &#8220;visible&#8221;. This animation is achieved by flipping through the frames forwards or backwards depending on what direction I want the gears to turn. The tricky part was figuring out how to get the gears to animate in sync with the sliding door container. What I discovered was that each component on the DisplayList will get a render event each time a render occurs. So what I did was add an event listener for this render event to one of the image controls like so:</p>
<p><code>i1.addEventListener(Event.RENDER, eventHandler);</code></p>
<p>Each render even will call the eventHandler function that will flip the displayed image to the next image in the animation. This works perfectly to keep the gears moving at the same speed as the sliding door. As each door render will cause the render event to fire on the image. This basically means that any easing function I place on the sliding door movement will also effect the gear animation. As the door accelerates or decelerated the gears speed up or slow down in sync. </p>
<p>One pitfall of using the render event is that it fires anytime anything causes the Flash player to render to the screen. This means that you must remove this even handler when you want the gear animation to stop. In this case the event listener is added when I start moving the door, and removed when the door is finished moving.</p>
<p>Feel free to post questions about the code or even suggestions on how to fix some of the poor code. I&#8217;ve learned a lot since I wrote this first application but, while I know how I personally would clean up some of this code, I know that there is always someone that can always teach me new tricks.</p>
<p>Here is the recompiled application with view source enabled:</p>
<p><iframe src="http://www.flexcodemonkey.com/blog/wp-content/uploads/flex/firsttry/FirstTry.html" width="100%" height="470"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexcodemonkey.com/blog/?feed=rss2&amp;p=40</wfw:commentRss>
		</item>
		<item>
		<title>How I became a Flex Addict</title>
		<link>http://www.flexcodemonkey.com/blog/?p=35</link>
		<comments>http://www.flexcodemonkey.com/blog/?p=35#comments</comments>
		<pubDate>Wed, 17 Dec 2008 15:47:40 +0000</pubDate>
		<dc:creator>skijunkie</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.flexcodemonkey.com/blog/?p=35</guid>
		<description><![CDATA[A little over two years ago if you asked me what I did at work, I would have said I was a Java SWING developer. I&#8217;d been programming in Java for about 6 years and I was happy. I developed enterprise application for my company and it was my language of choice for side &#8220;tinker&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>A little over two years ago if you asked me what I did at work, I would have said I was a Java SWING developer. I&#8217;d been programming in Java for about 6 years and I was happy. I developed enterprise application for my company and it was my language of choice for side &#8220;tinker&#8221; projects. A good friend of mine started working on a project in Flex 1.5 and for at least a year he tried to convince me to give it a try, but I didn&#8217;t give in until right about the time Flex 2 was released.</p>
<p>I finally broke down and bought the book <em>Adobe Flex 2: Training from the Source</em>. I spent a week following the books examples before I couldn&#8217;t contain myself and started my own test project. In my spare time spread out in a week I threw in every transition and effect I could discover into this test project. The code is not pretty and I know now that much of what I did is completely wrong causing me much more work than what was necessary. Yet the result was amazing. Here was a relatively clean application (albet with little real purpose) written in one week by a complete Flex neophyte that would have taken me a month in Java SWING (taking into account the animations, reflections, etc). I have experience writing my own real time animation rendering engine in Java, but in Flex it is virtually free.</p>
<p>Here is that first Flex project:</p>
<p><iframe src="http://www.flexcodemonkey.com/blog/wp-content/uploads/flex/FirstTry.swf" width="100%" height="520"></iframe></p>
<p>You can see it is nothing spectacular and it isn&#8217;t polished enough for a paying customer (the sounds I scrounged being particularly awful), but it speaks to how easily someone coming from event driven Java SWING can jump right in and work in Flex. This first two weeks of delving into Flex had gotten me hooked. If you know Java and have been hesitating on trying Flex, don&#8217;t wait. Give Flex a try. I still use Java all the time, but generally it is on the back end. The ability to seamlessly transfer Java objects and AS3 object over the network is wonderful, but that is a whole other discussion.</p>
<p>Since switching to Flex I&#8217;ve been lucky enough to lead a large team developing enterprise software using Flex to create custom components and also making extensive use of modules. In my spare time, I now tinker with AIR projects. If you ask me what I at work now, I&#8217;ll say I&#8217;m an RIA Flex developer.</p>
<p>I do apologize for not having included the source of this demo project. This SWF was built on Flex 2, and I have not yet recompiled it for Flex 3 with source included. I plan on doing just that in a future post. I&#8217;ll also dissect some of the code and explain how I got certain interesting parts working.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexcodemonkey.com/blog/?feed=rss2&amp;p=35</wfw:commentRss>
		</item>
	</channel>
</rss>
