<?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>Mrinal Wadhwa &#187; Flex</title>
	<atom:link href="http://weblog.mrinalwadhwa.com/category/flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://weblog.mrinalwadhwa.com</link>
	<description>en route to a richer Internet</description>
	<lastBuildDate>Wed, 12 Oct 2011 09:30:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Loop unwinding, for fast loops in AS3</title>
		<link>http://weblog.mrinalwadhwa.com/2010/11/22/loop-unwinding-for-fast-loops-in-as3/</link>
		<comments>http://weblog.mrinalwadhwa.com/2010/11/22/loop-unwinding-for-fast-loops-in-as3/#comments</comments>
		<pubDate>Mon, 22 Nov 2010 06:27:32 +0000</pubDate>
		<dc:creator>Mrinal Wadhwa</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[Duff's Device]]></category>
		<category><![CDATA[fast]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[loop unvinding]]></category>
		<category><![CDATA[perf]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://weblog.mrinalwadhwa.com/?p=1479</guid>
		<description><![CDATA[<p>I&#8217;ve been working on optimizing some javascript code these days and I came across a technique for optimizing long loops called <a href="http://en.wikipedia.org/wiki/Duff's_device">Duff&#8217;s Device</a> or <a href="http://en.wikipedia.org/wiki/Loop_unwinding">Loop Unwinding</a> which seems pretty well known in the javascript world but I haven&#8217;t seen anyone use it in actionscript code. </p>
<p>The basic idea is that there is a small overhead associated with executing the loop body, so if we unfold the loop in a way that it does the work of 8 iterations in 1 iteration, we can save some time. My tests show that in long enough loops this technique can give us <strong>8x to 10x performance gain</strong>. </p>
<p>Here are the results of my tests using <a href="http://gskinner.com/blog/archives/2010/02/performancetest.html">Grant Skinner&#8217;s performance test harness</a> &#8230;</p>
<p><script src="https://gist.github.com/709580.js?file=Perf%20Test"></script></p>
<p>Here are the actual test cases ..<!--more--> I borrowed the implementation from <a href="http://blog.millermedeiros.com/">Miller Medeiros&#8217;</a> javascript <a href="http://jsperf.com/duffs-device">test cases</a> and Jeff Greenberg&#8217;s <a href="http://home.earthlink.net/~kendrasg/info/js_opt/jsOptMain.html">original javascript implementation</a> &#8230; </p>
<p><script src="https://gist.github.com/709580.js?file=DuffsDevicePerfTest.as"></script>  </p>
]]></description>
		<wfw:commentRss>http://weblog.mrinalwadhwa.com/2010/11/22/loop-unwinding-for-fast-loops-in-as3/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Data Binding with Signals</title>
		<link>http://weblog.mrinalwadhwa.com/2010/05/29/data-binding-with-signals/</link>
		<comments>http://weblog.mrinalwadhwa.com/2010/05/29/data-binding-with-signals/#comments</comments>
		<pubDate>Sat, 29 May 2010 04:01:12 +0000</pubDate>
		<dc:creator>Mrinal Wadhwa</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[binding]]></category>
		<category><![CDATA[blu]]></category>
		<category><![CDATA[crayons]]></category>
		<category><![CDATA[data binding]]></category>
		<category><![CDATA[factors]]></category>
		<category><![CDATA[mrinal wadhwa]]></category>
		<category><![CDATA[signals]]></category>
		<category><![CDATA[signals and slots]]></category>
		<category><![CDATA[slots]]></category>

		<guid isPermaLink="false">http://weblog.mrinalwadhwa.com/?p=1449</guid>
		<description><![CDATA[<p>I haven&#8217;t talked much about our startup project <strong>factors</strong> on this blog yet, but you will hear more and more about it from me over the coming weeks. Today, we&#8217;re <a href="http://github.com/mrinalwadhwa/crayons.data.binding">open sourcing</a> a very small but quite interesting part of the factors web client code. The client is built mostly in AS3 using an in house framework we call crayons. Crayons provides an application architecture as well as a library of user interface components along with a component architecture, you could think of it as a mixture of functionality provided by flex framework and cairngorm, but several times lighter since it only implements functionality we need for factors and doesn&#8217;t try to be too generic.</p>
<p>Among other things Crayons has a built in <a href="http://github.com/mrinalwadhwa/crayons.data.binding">data binding framework</a> which we&#8217;re open sourcing today. Data binding in crayons in based on <a href="http://en.wikipedia.org/wiki/Signals_and_slots">Signals</a> where an object dispatches a specialized <strong>ChangeSignal</strong> whenever a bindable property changes, for example the setter of a bindable property data in SomeModel object would look like this &#8230;<!--more--></p>
<p><script src="http://gist.github.com/417951.js?file=gistfile1.as"></script></p>
<p>When an object signals a change in a property it has to pass in the old value of the property and the new value of the property. Unlike Flex, there is no [Bindable] metadata tag, an object can make one of its properties bindable by dispatching a ChangeSignal whenever that property changes. The <a href="http://github.com/mrinalwadhwa/crayons.data.binding/blob/master/src/crayons/signals/ChangeSignal.as">ChangeSignal implementation</a> is inspired by <a href="http://jacksondunstan.com/articles/585">Jackson Dunstan&#8217;s TurboSignals</a> instead of <a href="http://github.com/robertpenner/as3-signals">Rob Penner&#8217;s more flexible AS3Signals library</a> because using a specialized signal made sense in this scenario .. just like flex, signaling a change in a property is something we do a lot in a crayons application, for example to signal change in model data or change in the property of a component, for data binding  etc. so taking advantage of <a href="http://jacksondunstan.com/articles/585">the speed of a specialized signal</a> seemed reasonable. Also this especially helps data binding, since a <a href="http://github.com/mrinalwadhwa/crayons.data.binding/blob/master/src/crayons/data/binding/Binding.as">Binding</a> is really an implmentation of a <a href="http://github.com/mrinalwadhwa/crayons.data.binding/blob/master/src/crayons/signals/ChangeSlot.as">ChangeSlot</a> and Jackson&#8217;s <a href="http://jacksondunstan.com/articles/585">already shown</a> that such specialized slots are extremely fast. While in most cases its hard to justfy implementing a Slot interface just to add a listener and I would almost always go with adding a function listener, but in case of data binding since this is only used internally within the binding framework and the user of data binding is not bothered with it, implmentating a ChangeSlot was perfectly reasonable.</p>
<p>Now to use crayons data binding you can use a <a href="http://github.com/mrinalwadhwa/crayons.data.binding/blob/master/src/crayons/data/binding/Binder.as">Binder</a> object to bind a source ChangeSignal to a target property as follows &#8230;</p>
<p><script src="http://gist.github.com/417981.js?file=Example.as"></script>      </p>
<p>The <a href="http://github.com/mrinalwadhwa/crayons.data.binding/blob/master/src/crayons/data/binding/Binder.as">Binder</a> class provides some other interesting apis to remove binding or to check if a binding exists. This <a href="http://github.com/mrinalwadhwa/crayons.data.binding/tree/master/src/crayons/data/binding/">binding implementation</a> is heavily inspired from <a href="http://www.ericfeminella.com/blog/2010/03/22/as3-signals-simulated-data-binding/">Eric Feminella&#8217;s implementation</a> where he&#8217;s used as3signals. I refactored it for use with ChangeSignal and ChangeSlot and changed some other APIs for our needs.</p>
<p>That&#8217;s about it, you can get the complete crayons binding framework source code <a href="http://github.com/mrinalwadhwa/crayons.data.binding">here on Github</a>, do let me know what you think, any feedback would be very welcome.</p>
<p>Finally, I want to say thank you to Jackson Dunstan, Eric Feminella and Rob Penner who&#8217;s great work and research helped me implement this. I&#8217;ll buy you guys beer whenever we get a chance to meet <img src='http://weblog.mrinalwadhwa.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></description>
		<wfw:commentRss>http://weblog.mrinalwadhwa.com/2010/05/29/data-binding-with-signals/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Preloaders in AS3</title>
		<link>http://weblog.mrinalwadhwa.com/2010/04/02/preloaders-in-as3/</link>
		<comments>http://weblog.mrinalwadhwa.com/2010/04/02/preloaders-in-as3/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 16:19:37 +0000</pubDate>
		<dc:creator>Mrinal Wadhwa</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[application loader]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[preloader]]></category>
		<category><![CDATA[pure as3]]></category>
		<category><![CDATA[systemmanager]]></category>

		<guid isPermaLink="false">http://weblog.mrinalwadhwa.com/?p=1425</guid>
		<description><![CDATA[<p><strong>Update:</strong> Troy Gilbert suggested a much <a href="http://troygilbert.com/2010/04/minimal-preloader-for-as3/">better solution</a> for this in the comments below that uses -frame compiler option over the [Frame] metadata tag, I suggest you use his approach since it stops the compiler from bundling in Flex framework specific code like IFlexModuleFactory that you don&#8217;t really need.</p>
<p><strong>Update:</strong> Troy further improved his class <a href="http://troygilbert.com/2010/04/preloader-base-class/">here</a> </p>
<p>***</p>
<p>Today, I needed to create a preloader for a pure AS3 application compiled with mxmlc. I couldn&#8217;t find much documentation on the topic but this <a href="http://www.bit-101.com/blog/?p=946">post by Keith Peters</a> describes the solution in good detail, except his post is some what old and the code there doesn&#8217;t work with the latest compiler.. </p>
<p>As Keith <a href="http://www.bit-101.com/blog/?p=946">describes</a>, the first thing you need to do to implement a preloader is move your application to the second frame of the movie, this is done by adding a <strong>[Frame]</strong> metadata tag above your document class and providing it with a factory class that will initialize your application, in case of Flex this factory is <strong>mx.core.SystemManager</strong> ..<!--more--> we will have to write our own.</p>
<p>Your document class would now look something like this &#8230;</p>
<p><script src="http://gist.github.com/353181.js"></script></p>
<p>Our ApplicationLoader factory class has to extend MovieClip (not Sprite) and has to implement the interface mx.core.IFlexModuleFactory (this is the main change since Keith&#8217;s post). In the below code, I&#8217;ve stubbed out functions from IFlexModuleFactory and you can leave the code as is for most applications, you will only need to change this if your application loads other SWF&#8217;s at runtime or if you&#8217;re building an AIR application. </p>
<p>When we compile our Example application the compiler will generate a class (<a href="http://weblog.mrinalwadhwa.com/2007/07/09/flex-tip-of-the-day-keep-generated-actionscript/">you can see it with -keep</a>) that subclasses our ApplicationLoader factory and implements some additional functionality .. an instance of this sits in the first frame of our movie, loads the second frame that has our application and shows a preloader while the application loads &#8230;</p>
<p><script src="http://gist.github.com/353185.js"></script></p>
<p>You may change the look of your preloader in the onEnterFrame method but since this first frame needs to load quickly keep it light and avoid using any classes that are not native to Flash Player.</p>
<p>Finally thank&#8217;s to Keith for his <a href="http://www.bit-101.com/blog/?p=946">post that got me started</a> and also for all the other cool stuff I&#8217;ve learned from him over the years. </p>
]]></description>
		<wfw:commentRss>http://weblog.mrinalwadhwa.com/2010/04/02/preloaders-in-as3/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>SWF Machine: generating SWF binary from Erlang</title>
		<link>http://weblog.mrinalwadhwa.com/2010/03/17/swfmachine/</link>
		<comments>http://weblog.mrinalwadhwa.com/2010/03/17/swfmachine/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 22:38:27 +0000</pubDate>
		<dc:creator>Mrinal Wadhwa</dc:creator>
				<category><![CDATA[Erlang]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[binary]]></category>
		<category><![CDATA[bit-syntax]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[instructions]]></category>
		<category><![CDATA[swf]]></category>
		<category><![CDATA[swf-format]]></category>
		<category><![CDATA[swfmachine]]></category>

		<guid isPermaLink="false">http://weblog.mrinalwadhwa.com/?p=1409</guid>
		<description><![CDATA[<p>SWF Machine is an Erlang program I&#8217;ve been writing, to generate SWF files from Erlang. This program takes a custom instruction set as input and generates SWF binary instructions, which once saved in an SWF file can be  run in the Flash Player, here&#8217;s a quick demo of SWFMachine in action &#8230;</p>
<p><embed src="http://blip.tv/play/AYHN80oA" type="application/x-shockwave-flash" width="640" height="510" allowscriptaccess="always" allowfullscreen="true"></embed></p>
<p>A similar <a href="http://propella.blogspot.com/2009/03/learning-erlang-and-adobe-flash-format.html">attempt by Takashi Yamamiya</a> and the <a href="http://code.google.com/p/eswf/">eswf</a> library on google code  were quite helpful in getting me started, so thanks to them for sharing.</p>
]]></description>
		<wfw:commentRss>http://weblog.mrinalwadhwa.com/2010/03/17/swfmachine/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>An Introduction to Rich Internet Applications</title>
		<link>http://weblog.mrinalwadhwa.com/2010/01/24/an-introduction-to-rich-internet-applications/</link>
		<comments>http://weblog.mrinalwadhwa.com/2010/01/24/an-introduction-to-rich-internet-applications/#comments</comments>
		<pubDate>Sat, 23 Jan 2010 20:48:19 +0000</pubDate>
		<dc:creator>Mrinal Wadhwa</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[acm]]></category>
		<category><![CDATA[compute]]></category>
		<category><![CDATA[compute2010]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[flash player]]></category>
		<category><![CDATA[rich internet applications]]></category>

		<guid isPermaLink="false">http://weblog.mrinalwadhwa.com/?p=1334</guid>
		<description><![CDATA[<p>I had the opportunity to present a 4.5 hr lecture on <strong>Building Rich Internet Applications</strong> at <a href="http://compute.acmbangalore.org/">ACM&#8217;s Compute 2010</a> today. We started out by defining <a href="http://weblog.mrinalwadhwa.com/2008/10/24/what-is-an-ria/">what an RIA is</a> and exploring the various RIA platforms available, we then further explored the Flash Platform in more detail, wrote some <a href="http://github.com/mrinalwadhwa/flash-player-internals">experimental code</a> to understand the internals of Flash Player, looked at Flex 4 and its various new features and also spent some time understanding the <a href="http://weblog.mrinalwadhwa.com/2009/12/01/custom-components-in-flex-4/">Flex Component Lifecycle</a> </p>
<p>Here&#8217;s the slide deck from beginning of the lecture which tries to define what an RIA is and explores the architecture a typical RIA platform &#8230;</p>
<div style="width:640px;text-align:left" id="__ss_2978421"><object style="margin:0px" width="640" height="535"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=anintroductiontorichinternetapllications-100123132503-phpapp01&#038;rel=0&#038;stripped_title=an-introduction-to-rich-internet-apllications" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=anintroductiontorichinternetapllications-100123132503-phpapp01&#038;rel=0&#038;stripped_title=an-introduction-to-rich-internet-apllications" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="535"></embed></object></div>
<p>&nbsp;</p>
]]></description>
		<wfw:commentRss>http://weblog.mrinalwadhwa.com/2010/01/24/an-introduction-to-rich-internet-applications/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Going Commando in Flash Builder</title>
		<link>http://weblog.mrinalwadhwa.com/2009/12/03/going-commando-in-flash-builder/</link>
		<comments>http://weblog.mrinalwadhwa.com/2009/12/03/going-commando-in-flash-builder/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 01:49:35 +0000</pubDate>
		<dc:creator>Mrinal Wadhwa</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[cfeclipse]]></category>
		<category><![CDATA[commando]]></category>
		<category><![CDATA[flash builder]]></category>
		<category><![CDATA[flex builder]]></category>
		<category><![CDATA[flexbuilder]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[mouse]]></category>
		<category><![CDATA[shortcuts]]></category>
		<category><![CDATA[snippets]]></category>
		<category><![CDATA[sniptreeview]]></category>
		<category><![CDATA[textmate]]></category>

		<guid isPermaLink="false">http://weblog.mrinalwadhwa.com/?p=1286</guid>
		<description><![CDATA[<p>Along with the <a href="http://weblog.mrinalwadhwa.com/2009/12/01/custom-components-in-flex-4/">Custom Components in Flex 4</a> presentation I shared yesterday, I also gave a 15 minute lightening talk at <a href="endtoend.in/apps/forms/adobe/DevSummitNovDec09/home.html">Adobe DevSummit</a> on <strong>Keyboard Productivity in Flash Builder</strong>, this was just a quick show and tell where I walked people through various ways of what <a href="http://www.codinghorror.com/">Jeff Atwood</a> calls <a href="http://www.codinghorror.com/blog/archives/000825.html">Going Commando</a> &#8230;<!--more--></p>
<p>
<h4>Shortcuts</h4>
<p>Here are some Flash Builder Keyboard shortcuts I use very frequently, if you have suggestions on others that are especially handy, please let me know &#8230;  </p>
<table border="0" width="100%">
<tr>
<td><strong>CMD + 3</strong></td>
<td>- <a href="http://en.wikipedia.org/wiki/Swiss_Army_knife">the swiss knife</a> of a commando, jump to anywhere inside eclipse</td>
</tr>
<tr>
<td><strong>CMD + SHIFT + T</strong> </td>
<td>- find type</td>
</tr>
<tr>
<td><strong>CMD + SHIFT + R</strong> </td>
<td>- find resource</td>
</tr>
<tr>
<td><strong>CMD + O</strong></td>
<td>- find/jump within class</td>
</tr>
<tr>
<td><strong>CMD + E</strong></td>
<td>- switch editors (CMD 3 also works for this)</td>
</tr>
<tr>
<td><strong>CMD + D</strong></td>
<td>- delete line which has cursor, without having to select</td>
</tr>
<tr>
<td><strong>ALT + Up/Down Arrows</strong></td>
<td>- Move Line/Selection Up/Down</td>
</tr>
<tr>
<td><strong>ALT + CMD + Up/Down Arrows</strong></td>
<td>- Copy Line/Selection Up/Down</td>
</tr>
<tr>
<td><strong>CMD + W</strong></td>
<td>- Close tab</td>
</tr>
</table>
<p><em>* CMD on OSX = CTRL on Windows</em></p>
<p>
<h4>Customize</h4>
<p>If you press CMD+3 and type &#8220;keys&#8221;, you&#8217;ll see the keyboard customization preferences panel for Flash Builder, I recommend spending some time customizing Builder for your own needs, for example I use CMD+1 and CMD+2 to switch between Develop/Debug perspectives. I barely use the NumPad on my keyboard so I&#8217;ve customized it to be all keyboard shortcuts, pressing CMD+0 inserts snippets </p>
<p>
<h4>Snippets</h4>
<p>Having a good snippets plugin can greatly improve a developer&#8217;s productivity, I love how Snippets work in <a href="http://macromates.com/">TextMate</a>, I&#8217;m still searching for a good solution for this in Flash Builder, till now I&#8217;ve been using <a href="http://www.andymcintosh.com/?p=116">CFEclipse&#8217;s SnipTreeView</a> but the problem is it only works with AS3 code and can&#8217;t handle MXML. I was so desperate one day that I figured out that it fails because  the CFEclipse <a href="http://trac.cfeclipse.org/browser/org.cfeclipse.cfml/trunk/src/org/cfeclipse/cfml/editors/actions/InsertSnippetAction.java">InsertSnippetAction class on Line No 71</a> assumes that the editor is an ITextEditor, while this is true for most Eclipse editors, the MXML editor is actually made of 2 editors a Design Editor and an ITextEditor, so the type cast on Line 71 fails &#8230; I never got to building CFEclipse on my own though. But, it looks like <a href="http://theflashblog.com/">Lee Brimelow</a> did, he has released <a href="http://theflashblog.com/?p=1494">a fix which makes SnipTreeView work</a> with MXML editor, unfortunately though Lee&#8217;s fix doesn&#8217;t work for me because of a Java version issue on OSX Leopard.        </p>
<p>Another handy Mac only tool is <a href="http://www.smileonmymac.com/TextExpander/">TextExpander</a>. It sometimes breaks your formatting in eclipse, but that has gotten better with Flash Builders new auto formatting improvements.
</p>
<p>
<h4>Multi Clipboard</h4>
<p>A multi-clipboard tool is another must have for all developers, I use <a href="http://jumpcut.sourceforge.net/">Jumpcut</a> on OSX and it is a big big productivity boost to not have switch between files and applications when copying and pasting. I don&#8217;t know any good equivalent for Windows, so if you know of one, please let me know. </p>
<p>Finally, I have to thank <a href="http://www.riageeks.com/">Chetan Sachdev</a> because he got me hooked to optimizing my workflow using the keyboard while we were working together on a project earlier this year.
</p>
<p>I would love to know if you have any other handy tips on Going Commando. </p>
]]></description>
		<wfw:commentRss>http://weblog.mrinalwadhwa.com/2009/12/03/going-commando-in-flash-builder/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Custom Components in Flex 4</title>
		<link>http://weblog.mrinalwadhwa.com/2009/12/01/custom-components-in-flex-4/</link>
		<comments>http://weblog.mrinalwadhwa.com/2009/12/01/custom-components-in-flex-4/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 11:21:21 +0000</pubDate>
		<dc:creator>Mrinal Wadhwa</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[components]]></category>
		<category><![CDATA[custom components]]></category>
		<category><![CDATA[flex4]]></category>
		<category><![CDATA[halo]]></category>
		<category><![CDATA[spark]]></category>

		<guid isPermaLink="false">http://weblog.mrinalwadhwa.com/?p=1252</guid>
		<description><![CDATA[<p>I gave a presentation on <strong>Custom Components in Flex 4</strong> at <a href="http://endtoend.in/apps/forms/adobe/DevSummitNovDec09/home.html">Adobe Devsummit</a> last week in Chennai and today in Hyderabad, here&#8217;s the slidedeck where we create an <a href="http://en.wikipedia.org/wiki/Imperial_stormtrooper">Imperial StormTrooper</a> component</p>
<div style="width:640px;text-align:left" id="__ss_2622384"><object style="margin:0px" width="640" height="535"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=customcomponentsinflex4-091201050800-phpapp02&#038;stripped_title=custom-components-in-flex-4" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=customcomponentsinflex4-091201050800-phpapp02&#038;stripped_title=custom-components-in-flex-4" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="535"></embed></object></div>
<p></p>
]]></description>
		<wfw:commentRss>http://weblog.mrinalwadhwa.com/2009/12/01/custom-components-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Flex 4: Random Layout and Step Layout</title>
		<link>http://weblog.mrinalwadhwa.com/2009/08/22/flex-4-random-layout-and-step-layout/</link>
		<comments>http://weblog.mrinalwadhwa.com/2009/08/22/flex-4-random-layout-and-step-layout/#comments</comments>
		<pubDate>Sat, 22 Aug 2009 14:01:00 +0000</pubDate>
		<dc:creator>Mrinal Wadhwa</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[cool]]></category>
		<category><![CDATA[flex4]]></category>
		<category><![CDATA[gumbo]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[spark]]></category>

		<guid isPermaLink="false">http://weblog.mrinalwadhwa.com/?p=1142</guid>
		<description><![CDATA[<p>Yesterday at the <a href="http://bangalorefx.org">Bangalore Flex User Group</a> Meeting after <a href="http://www.thepixelcode.com/development/data-services/model-driven-development-using-lcds-3">Khan&#8217;s excellent talk</a> on LCDS3, Fiber and the Modeler Plugin we had some time left to so I decided to show everyone how cool and easy <a href="http://opensource.adobe.com/wiki/display/flexsdk/Spark+Horizontal+and+Vertical+Layout">layouts in Flex 4</a> are .. </p>
<p>Here are two quick layouts we wrote during the meeting as I showed everyone how easy it is to write a custom layout &#8230;</p>
<h4>Random Layout</h4>
<p><object width="650" height="380"><param name="movie" value="http://experiments.mrinalwadhwa.com/Flex4Layouts/RandomLayoutExample.swf"><embed src="http://experiments.mrinalwadhwa.com/Flex4Layouts/RandomLayoutExample.swf" width="650" height="380"></embed></param></object></p>
<h4>Step Layout</h4>
<p><object width="650" height="380"><param name="movie" value="http://experiments.mrinalwadhwa.com/Flex4Layouts/StepLayoutExample.swf"><embed src="http://experiments.mrinalwadhwa.com/Flex4Layouts/StepLayoutExample.swf" width="650" height="380"></embed></param></object></p>
<p>These layouts are currently somewhat crude but the idea was to convey how easy it is to write your own layouts &#8230; here the code for RandomLayout &#8230; just one simple function &#8230;<!--more--></p>
<p><iframe src ="http://experiments.mrinalwadhwa.com/Flex4Layouts/srcview/source/com/mrinalwadhwa/layouts/RandomLayout.as.html" width="100%" height="300"><br />
</iframe></p>
<p>Of course, these layout algorithms can get more complex &#8230; here&#8217;s the StepLayout code &#8230; </p>
<p><iframe src ="http://experiments.mrinalwadhwa.com/Flex4Layouts/srcview/source/com/mrinalwadhwa/layouts/StepLayout.as.html" width="100%" height="300"><br />
</iframe></p>
<p>For more elaborate examples you may want to checkout the <a href="http://weblog.mrinalwadhwa.com/2009/08/16/flex-4-concentric-layout/">ConcentricLayout</a> example I posted last week or Ryan Campbell&#8217;s very<a href="http://www.bobjim.com/2009/06/16/heres-5-3d-layouts-for-flex-4/"> cool 3D Layouts</a>. Evtim, an engineer on the Flex SDK team also has some <a href="http://evtimmy.com/category/custom-layout/">detailed posts on how to write Layouts</a> on his blog.  </p>
<p>Flex 4 is awesome.</p>
<hr />
<p><strong>UPDATE:</strong> You can view the complete source of the above example <a href="http://experiments.mrinalwadhwa.com/Flex4Layouts/srcview/">here</a> or download it from <a href="http://experiments.mrinalwadhwa.com/Flex4Layouts/srcview/Flex4layouts.zip">here.</a> </p>
<hr />
]]></description>
		<wfw:commentRss>http://weblog.mrinalwadhwa.com/2009/08/22/flex-4-random-layout-and-step-layout/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Flex 4 Concentric Layout</title>
		<link>http://weblog.mrinalwadhwa.com/2009/08/16/flex-4-concentric-layout/</link>
		<comments>http://weblog.mrinalwadhwa.com/2009/08/16/flex-4-concentric-layout/#comments</comments>
		<pubDate>Sun, 16 Aug 2009 16:16:49 +0000</pubDate>
		<dc:creator>Mrinal Wadhwa</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[concentric layout]]></category>
		<category><![CDATA[flex4]]></category>
		<category><![CDATA[gumbo]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[layouts]]></category>
		<category><![CDATA[spark]]></category>

		<guid isPermaLink="false">http://weblog.mrinalwadhwa.com/?p=1121</guid>
		<description><![CDATA[<p><a href="http://opensource.adobe.com/wiki/display/flexsdk/Spark+Horizontal+and+Vertical+Layout">Layouts in Flex 4</a> are decoupled from containers and its quite simple to define your own layout. Yesterday I wrote ConcentricLayout. </p>
<p><strong>ConcentricLayout</strong> arranges layout elements in such a way that their centers are aligned and their size sequentially decreases. The width of each layout element is less than the previous element by a value specified using the <em>horizontalGap</em> property and the height of each layout element is less than the previous element by a value specified using the <em>verticalGap</em> property. If the element has an explicit width or an explicit height it still aligns its center but is not resized. You can tell the layout to force a resize of all elements and ignore their explicitly specified size using the <em>forceResize</em> flag</p>
<p>Here&#8217;s a quick example: </p>
<p><object width="550" height="400"><param name="movie" value="http://experiments.mrinalwadhwa.com/ConcentricLayout/ConcentricLayout.swf"><embed src="http://experiments.mrinalwadhwa.com/ConcentricLayout/ConcentricLayout.swf" width="650" height="380"></embed></param></object></p>
<h3><a href="http://experiments.mrinalwadhwa.com/ConcentricLayout/srcview/">View Source</a></h3>
<h3><a href="http://experiments.mrinalwadhwa.com/ConcentricLayout/srcview/ConcentricLayout.zip">Download Source</a></h3>
<p>&nbsp;</p>
]]></description>
		<wfw:commentRss>http://weblog.mrinalwadhwa.com/2009/08/16/flex-4-concentric-layout/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Gradient fidelity and FXG generation tools</title>
		<link>http://weblog.mrinalwadhwa.com/2009/08/02/gradient-fidelity-and-fxg/</link>
		<comments>http://weblog.mrinalwadhwa.com/2009/08/02/gradient-fidelity-and-fxg/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 23:39:10 +0000</pubDate>
		<dc:creator>Mrinal Wadhwa</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[catalyst]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[flex4]]></category>
		<category><![CDATA[fxg]]></category>
		<category><![CDATA[generate]]></category>
		<category><![CDATA[illustrator]]></category>
		<category><![CDATA[tool]]></category>

		<guid isPermaLink="false">http://weblog.mrinalwadhwa.com/?p=1079</guid>
		<description><![CDATA[<p>Last week I got some <a href="http://www.adobe.com/products/illustrator/">Illustrator</a> files from the designer on our team, which I had to convert into Flex 4 skins. When we had planned this, we thought this would be easy &#8230; the designer makes the skins in Illustrator, we export FXG directly from Illustrator or we import them into <a href="http://labs.adobe.com/technologies/flashcatalyst/">Catalyst</a>, do some tweaking and then export to get FXG that we can use in SparkSkins .. unfortunately it wasn&#8217;t that simple, I&#8217;m documenting some of the gotchas and workarounds I learned for anyone else who may run into the same situation.</p>
<p>Most of the problems we had were related to gradients, here are some snapshots &#8230;</p>
<p><img src="http://weblog.mrinalwadhwa.com/wp-content/uploads/2009/08/ai.png" alt="Original Graphic created in Illustrator" /><br />
<img src="http://weblog.mrinalwadhwa.com/wp-content/uploads/2009/08/fxg.png" alt="FXG Exported from Illustrator" /><br />
<img src="http://weblog.mrinalwadhwa.com/wp-content/uploads/2009/08/fxg-catalyst.png" alt="FXG Exported from Catalyst" />  </p>
<ol>
<li>The first strip is original graphic created in Illustrator</li>
<li>The second strip FXG Exported from Illustrator</li>
<li>The third strip is original Illustrator file imported into Catalyst and then FXG exported from Catalyst</li>
</ol>
<p>Clearly, all of them are different.<!--more--> While this difference may not feel significant when looked at in this isolated manner, if you have many gradients in your design it can significantly affect the fidelity of the design.</p>
<p>Here&#8217;s the code generated by Illustrator&#8217;s FXG export feature ..<br />
<img src="http://weblog.mrinalwadhwa.com/wp-content/uploads/2009/08/ai-fxg-code.png" alt="Code of FXG exported from Illustrator" />  </p>
<p>Here&#8217;s the code generated by first importing the Illustrator file into Catalyst and then exporting FXG ..<br />
<img src="http://weblog.mrinalwadhwa.com/wp-content/uploads/2009/08/catalyst-fxg-code.png" alt="Code of FXG exported from Catalyst" /> </p>
<p>Note that the colors exported by each are different.</p>
<p><em><strong>Suggestion:</strong> Illustrator&#8217;s FXG export should have a way to add namespace prefixes while exporting, would be helpful</em>  </p>
<p>At this point, I asked about this problem on an Adobe forum and one of the team members replied and suggested I should &#8230; In Illustrator, convert colors to SRGB and turn off color management. So I did that.<br />
Here&#8217;s the original followed by what it looks like with the new settings &#8230; </p>
<p><img src="http://weblog.mrinalwadhwa.com/wp-content/uploads/2009/08/ai.png" alt="Original Graphic created in Illustrator" /><br />
<img src="http://weblog.mrinalwadhwa.com/wp-content/uploads/2009/08/ai-colormanagementoff.png" alt="Original with Color Management turned off" />  </p>
<p>So, our designer will have to redo some work in the new settings to create the original look, that&#8217;s fine, as long as we can get the exact same look in out final Flex application. But that didn&#8217;t work out either ..</p>
<ol>
<li>The original graphic with the new color settings applied</li>
<li>FXG exported from illustrator</li>
<li>FXG exported from Catalyst</li>
<li>The original graphic without the new color settings</li>
</ol>
<p><img src="http://weblog.mrinalwadhwa.com/wp-content/uploads/2009/08/ai-colormanagementoff.png" alt="Original with Color Management turned off" /><br />
<img src="http://weblog.mrinalwadhwa.com/wp-content/uploads/2009/08/fxg-catalyst-c.png" alt="FXG exported from Illustrator with Color Management turned off" /><br />
<img src="http://weblog.mrinalwadhwa.com/wp-content/uploads/2009/08/fxg-catalyst-c.png" alt="FXG exported from Catalyst" /><br />
<img src="http://weblog.mrinalwadhwa.com/wp-content/uploads/2009/08/ai.png" alt="Original Graphic created in Illustrator" />   </p>
<p>Here&#8217;s the code of FXG exported from Illustrator &#8230;<br />
<img src="http://weblog.mrinalwadhwa.com/wp-content/uploads/2009/08/fxg-ci-code-c.png" alt="" /> </p>
<p>Here&#8217;s the code of FXG exported from Catalyst &#8230;<br />
<img src="http://weblog.mrinalwadhwa.com/wp-content/uploads/2009/08/fxg-catalyst-code-c.png" alt="" /> </p>
<p>Note that this time both the FXGs are exactly the same except they still don&#8217;t look like the desired look drawn in Illustrator. Even if we use different color settings.</p>
<p>Now I noticed that Illustrator also allows exporting to <a href="http://www.w3.org/Graphics/SVG/">SVG</a> so I exported my original graphic as SVG &#8230;</p>
<ol>
<li>Original</li>
<li>SVG exported from Illustrator</li>
</ol>
<p><img src="http://weblog.mrinalwadhwa.com/wp-content/uploads/2009/08/ai.png" alt="Original Graphic created in Illustrator" /><br />
<img src="http://weblog.mrinalwadhwa.com/wp-content/uploads/2009/08/svg.png" alt="SVG" />   </p>
<p>So that&#8217;s not perfect either but its much closer than any of the FXG output above &#8230;</p>
<p>When I looked at the code of the exported SVG  &#8230;<br />
<img src="http://weblog.mrinalwadhwa.com/wp-content/uploads/2009/08/svg-code.png" alt="SVG" />   </p>
<p>Clearly there is more color detail in there, it has 10 gradient stops as opposed to only 3 in the FXG output we got, this explains lower fidelity of our FXG output .. so I translated this SVG <strong>manually</strong> to FXG ..</p>
<p><img src="http://weblog.mrinalwadhwa.com/wp-content/uploads/2009/08/fxg-modified-code.png" alt="SVG" />   </p>
<p>Here&#8217;s the original followed by the final FXG I created manually &#8230;  </p>
<p><img src="http://weblog.mrinalwadhwa.com/wp-content/uploads/2009/08/ai.png" alt="Original Graphic created in Illustrator" /><br />
<img src="http://weblog.mrinalwadhwa.com/wp-content/uploads/2009/08/fxg-modified.png" alt="Modified FXG" />   </p>
<p>Not perfect, but fairly close.</p>
<p><em><strong>Suggestion:</strong> Illustrator and Catalyst FXG export should not drop gradient stops</em></p>
<p>Since, Catalyst is still in beta, I think Adobe will probably fix this by the time it releases but till then you can use the SVG workaround if you run into a similar situation.</p>
<p>I had to convince our designer to settle at &#8220;fairly close&#8221; for now, but if this Designer-Developer Workflow thing has to work, we need to get better at generating the exact look a designer draws in his/her design tool, at the click of  a button. </p>
]]></description>
		<wfw:commentRss>http://weblog.mrinalwadhwa.com/2009/08/02/gradient-fidelity-and-fxg/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Flex4/FXG EllipticalArc Primitive</title>
		<link>http://weblog.mrinalwadhwa.com/2009/07/21/fxg-ellipticalarc-primitive/</link>
		<comments>http://weblog.mrinalwadhwa.com/2009/07/21/fxg-ellipticalarc-primitive/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 22:37:30 +0000</pubDate>
		<dc:creator>Mrinal Wadhwa</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[degrafa]]></category>
		<category><![CDATA[ellipticalarc]]></category>
		<category><![CDATA[flex4]]></category>
		<category><![CDATA[fxg]]></category>
		<category><![CDATA[gumbo]]></category>
		<category><![CDATA[primitive]]></category>

		<guid isPermaLink="false">http://weblog.mrinalwadhwa.com/?p=1025</guid>
		<description><![CDATA[<p>Flex 4 does not have an EllipticalArc primitive yet, but I needed one today .. thankfully <a href="http://degrafa.org">Degrafa</a> already has an <a href="http://degrafa.googlecode.com/svn/branches/Origin/Degrafa/com/degrafa/geometry/EllipticalArc.as">EllipticalArc Class</a>, I translated that to work with Flex 4.</p>
<p>EllipticalArc is a <a href="http://livedocs.adobe.com/flex/gumbo/langref/spark/primitives/supportClasses/FilledElement.html">FilledElement</a> so it can have a Fill and a Stroke just like other FilledElements  <a href="http://livedocs.adobe.com/flex/gumbo/langref/spark/primitives/Rect.html">Rect</a>, <a href="http://livedocs.adobe.com/flex/gumbo/langref/spark/primitives/Ellipse.html">Ellipse</a> etc.</p>
<p><object width="650" height="900"><param name="movie" value="http://experiments.mrinalwadhwa.com/EllipticalArc/Example.swf"><embed src="http://experiments.mrinalwadhwa.com/EllipticalArc/Example.swf"  width="650" height="900"></embed></param></object></p>
<h4><a href="http://experiments.mrinalwadhwa.com/EllipticalArc/">View Example</a></h4>
<h4><a href="http://code.google.com/p/ellipticalarc/source/browse/trunk/src/com/mrinalwadhwa/primitives/EllipticalArc.as">View Source</a></h4>
<p>I haven&#8217;t yet implemented some of the layout related functionality that other primitives like Rect, Ellipse etc implement &#8230; but it seems to work fine with basic layouts, which is what I needed for now. The class is <a href="http://code.google.com/p/ellipticalarc/">hosted on Google code</a> under the Apache 2.0 License, just in case someone wants to improve it.</p>
<p>Thank you to the <a href="http://degrafa.org">Degrafa</a> team for sharing their amazing work that saves me loads of time every now and then.</p>
]]></description>
		<wfw:commentRss>http://weblog.mrinalwadhwa.com/2009/07/21/fxg-ellipticalarc-primitive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Presenting Flex 4 Component Lifecycle at FlexMania</title>
		<link>http://weblog.mrinalwadhwa.com/2009/07/04/flexmania/</link>
		<comments>http://weblog.mrinalwadhwa.com/2009/07/04/flexmania/#comments</comments>
		<pubDate>Sat, 04 Jul 2009 00:52:09 +0000</pubDate>
		<dc:creator>Mrinal Wadhwa</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[2009]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[brazil]]></category>
		<category><![CDATA[flex mania]]></category>
		<category><![CDATA[flex4]]></category>
		<category><![CDATA[flexmania]]></category>
		<category><![CDATA[mania]]></category>
		<category><![CDATA[mrinal]]></category>
		<category><![CDATA[mrinal wadhwa]]></category>
		<category><![CDATA[mrinalwadhwa]]></category>
		<category><![CDATA[present]]></category>
		<category><![CDATA[talk]]></category>

		<guid isPermaLink="false">http://weblog.mrinalwadhwa.com/?p=989</guid>
		<description><![CDATA[<p><a href="http://www.flexmania.com.br/"><img src="http://weblog.mrinalwadhwa.com/wp-content/uploads/2009/07/flexmania.jpg" alt="FlexMania" width="100%"/></a></p>
<p><a href="http://www.flexmania.com.br/">FlexMania</a> is a Brazilian online event organized by <a href="http://www.igorcosta.org/">Igor Costa</a>. The event is focused on the Flash Platform and has a great collection of Flash/Flex/AIR related <a href="http://www.flexmania.com.br/calendario.html">talks</a>.</p>
<p>Although, most of the talks are in portuguese, there are some interesting english sessions as well like Laura Arguello on <a href="http://mate.asfusion.com/">Mate Framework</a>, Stephen Downs (a.k.a Tink) on <a href="http://www.efflex.org/">Efflex</a> and Iiley Chen on <a href="http://www.aswing.org/">AsWing</a>    </p>
<p>I will also be presenting in english, my talk is &#8220;A Flex 4 Component&#8217;s Lifecycle&#8221; on Monday, July 6th at 15:30 GMT. </p>
<hr />
<strong>RECORDING: </strong>Here&#8217;s the 1hr long <a href="http://go.mrinalwadhwa.com/flext4"> Adobe Connect recording </a> of the talk from FlexMania</p>
<p><strong>SLIDES AND CODE: </strong>The <a href="http://weblog.mrinalwadhwa.com/2009/06/21/flex-4-component-lifecycle/">slides and code</a> from the talk can be found <a href="http://weblog.mrinalwadhwa.com/2009/06/21/flex-4-component-lifecycle/">here</a></p>
<hr />
]]></description>
		<wfw:commentRss>http://weblog.mrinalwadhwa.com/2009/07/04/flexmania/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Flex 4 Component Lifecycle (Slides and Code)</title>
		<link>http://weblog.mrinalwadhwa.com/2009/06/21/flex-4-component-lifecycle/</link>
		<comments>http://weblog.mrinalwadhwa.com/2009/06/21/flex-4-component-lifecycle/#comments</comments>
		<pubDate>Sun, 21 Jun 2009 17:52:42 +0000</pubDate>
		<dc:creator>Mrinal Wadhwa</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[component]]></category>
		<category><![CDATA[components]]></category>
		<category><![CDATA[flex4]]></category>
		<category><![CDATA[gumbo]]></category>
		<category><![CDATA[halo]]></category>
		<category><![CDATA[spark]]></category>

		<guid isPermaLink="false">http://weblog.mrinalwadhwa.com/?p=945</guid>
		<description><![CDATA[<p>I gave a talk this Friday on the lifecycle of a component in <a href="http://opensource.adobe.com/wiki/display/flexsdk/Gumbo">Flex 4</a>. The talk went into the details of how the flash player works, why a component needs a lifecycle and the various stages of a components life.</p>
<hr />
<strong>UPDATE: </strong> I gave the same talk at <a href="http://weblog.mrinalwadhwa.com/2009/07/04/flexmania/">FlexMania</a> .. Here&#8217;s the 1hr long <a href="http://go.mrinalwadhwa.com/flext4"> Adobe Connect recording </a><br />
&nbsp;</p>
<hr />
<p>Here are the slides and experimental code from the talk &#8230; </p>
<p><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0" width="650" height="550"><param name="movie" value="https://share.acrobat.com/adc/flex/mpt.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent"/><param name="allowFullScreen" value="true"/><param name="flashvars"  value="ext=pdf&#038;docId=3538fc34-e9f8-4264-97e1-12ee8aca6cbf&#038;lang=en_US"/><embed src="https://share.acrobat.com/adc/flex/mpt.swf"  quality="high"  pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"  type="application/x-shockwave-flash" width="650" height="550" wmode="transparent" allowFullScreen="true" flashvars="ext=pdf&#038;docId=3538fc34-e9f8-4264-97e1-12ee8aca6cbf&#038;lang=en_US"></embed></object></p>
<p>Here&#8217;s the code we played with to understand how frame rates work in the flash player &#8230; <!--more--></p>
<p><a href="http://experiments.mrinalwadhwa.com/flex4lifecycle_talk/source/FrameRates.as.html"></p>
<h3>FrameRates.as</h3>
<p></a></p>
<p><iframe src ="http://experiments.mrinalwadhwa.com/flex4lifecycle_talk/source/FrameRates.as.html" width="100%" height="300"><br />
</iframe></p>
<p>Here&#8217;s the code we wrote with to understand the <a href="http://www.onflex.org/ted/2005/07/flash-player-mental-model-elastic.php">Elastic Racetrack</a> &#8230;</p>
<p><a href="http://experiments.mrinalwadhwa.com/flex4lifecycle_talk/source/ElasticRaceTrack.as.html"></p>
<h3>ElasticRaceTrack.as</h3>
<p></a></p>
<p><iframe src ="http://experiments.mrinalwadhwa.com/flex4lifecycle_talk/source/ElasticRaceTrack.as.html" width="100%" height="300"><br />
</iframe></p>
<p>Here&#8217;s the experiment to understand <a href="http://www.craftymind.com/2008/04/18/updated-elastic-racetrack-for-flash-9-and-avm2/">marshaled slices</a> &#8230;</p>
<p><a href="http://experiments.mrinalwadhwa.com/flex4lifecycle_talk/source/MarshalledSlices.as.html"></p>
<h3>MarshaledSlices.as</h3>
<p></a></p>
<p><iframe src ="http://experiments.mrinalwadhwa.com/flex4lifecycle_talk/source/MarshalledSlices.as.html" width="100%" height="300"><br />
</iframe></p>
<blockquote><p>
<a href="http://weblog.mrinalwadhwa.com/wp-content/uploads/2009/06/flex-4-component-lifecycle.pdf"><strong>Download Slides</strong></a><br />
<a href="http://experiments.mrinalwadhwa.com/flex4lifecycle_talk/testproject.zip"><strong>Download Source Code</strong></a>
</p></blockquote>
<p>The presentation was slightly long and I&#8217;ve already heard that some people <a href="http://cfmitrah.com/blog/post.cfm/coldfusion-9-bolt-meeting-at-bangalore">found it boring</a> but I hope that wasn&#8217;t the case for everyone <img src='http://weblog.mrinalwadhwa.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I would like to thank all the awesome people in the Flash/Flex community who have helped me understand all this by publishing some great articles and blog posts &#8230; here are just some of the articles that I&#8217;ve found very useful &#8230;<br />
<a href="http://www.onflex.org/ted/2005/07/flash-player-mental-model-elastic.php"><br />
Ted Patrick on the Elastic Racetrack</a><a href="http://www.craftymind.com/2008/04/18/updated-elastic-racetrack-for-flash-9-and-avm2/"><br />
Sean Christmann&#8217;s Updated ‘Elastic Racetrack’ for Flash 9 and AVM2</a><br />
Ely Greenfrield on <a href="http://onflex.org/ACDS/BuildingAFlexComponent.pdf">Building a Flex Component</a> [PDF] (Thanks Ted Patrick for making it available on his blog)<br />
<a href="http://weblog.mrinalwadhwa.com/2009/02/17/understanding-the-flex-component-lifecycle/">&#8220;Diving Deep With the Flex Component Lifecycle,&#8221;</a> by <a href="http://bradumbaugh.blogspot.com/">Brad Umbaugh</a> and <a href="http://rjria.blogspot.com/">RJ Owen</a><br />
<a href="http://www.developmentarc.com/site/articles/">White Paper by the guys at Development Arc on Component Lifecycle </a></p>
<p>Please do let me know what you thought of my talk and how I can improve it.</p>
]]></description>
		<wfw:commentRss>http://weblog.mrinalwadhwa.com/2009/06/21/flex-4-component-lifecycle/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
		<item>
		<title>Flex 4 Component Lifecycle</title>
		<link>http://weblog.mrinalwadhwa.com/2009/06/12/flex-4-component-lifecycle-2/</link>
		<comments>http://weblog.mrinalwadhwa.com/2009/06/12/flex-4-component-lifecycle-2/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 09:43:50 +0000</pubDate>
		<dc:creator>Mrinal Wadhwa</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[India]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[bangalorefx]]></category>
		<category><![CDATA[flex 4 component lifecycle]]></category>
		<category><![CDATA[flex4]]></category>
		<category><![CDATA[gumbo]]></category>
		<category><![CDATA[halo]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[spark]]></category>
		<category><![CDATA[talk]]></category>

		<guid isPermaLink="false">http://weblog.mrinalwadhwa.com/?p=936</guid>
		<description><![CDATA[<p>I&#8217;ll be presenting a talk on Flex 4 Component Lifecycle at the next <a href="http://bangalorefx.org">Bangalore Flex User Group Meeting</a> on 19th. <!--more--></p>
<p>The talk will be an in depth walk through of the life cycle of a component in Flex 4. The Flex 4 component model (Spark) is built on top of Flex 3 component model (Halo), so we will also take a detailed look at the Flex 3 lifecycle.</p>
<p>I am not planning to do a feature by feature overview of new features in Flex 4, so it would help if you already know a little bit about that. These articles are a good place to start ..</p>
<blockquote><p>Matt Chotin on <a href="http://www.adobe.com/devnet/flex/articles/flex4sdk_whatsnew.html">What&#8217;s new in Flex 4 Beta</a><br />
Joan Lafferty on <a href="http://www.adobe.com/devnet/flex/articles/flex3and4_differences.html">Differences between Flex 3 and Flex 4 beta</a></p></blockquote>
<p>Check out the <a href="http://bangalorefxjune09.eventbrite.com/">event page</a> for registration and other details.</p>
<p>Look forward to seeing you all there.</p>
<hr />
<p>UPDATE: I&#8217;ve posted the slides and code from the talk <a href="http://weblog.mrinalwadhwa.com/2009/06/21/flex-4-component-lifecycle/">here</a>    </p>
]]></description>
		<wfw:commentRss>http://weblog.mrinalwadhwa.com/2009/06/12/flex-4-component-lifecycle-2/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>FXG paths to Flex components convertor</title>
		<link>http://weblog.mrinalwadhwa.com/2009/05/08/fxg-paths-to-flex-components-convertor/</link>
		<comments>http://weblog.mrinalwadhwa.com/2009/05/08/fxg-paths-to-flex-components-convertor/#comments</comments>
		<pubDate>Fri, 08 May 2009 10:39:59 +0000</pubDate>
		<dc:creator>Mrinal Wadhwa</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[flash catalyst]]></category>
		<category><![CDATA[flex4]]></category>
		<category><![CDATA[fxg]]></category>
		<category><![CDATA[illustrator]]></category>
		<category><![CDATA[path]]></category>
		<category><![CDATA[skin]]></category>
		<category><![CDATA[spark]]></category>
		<category><![CDATA[thermo]]></category>
		<category><![CDATA[vector]]></category>
		<category><![CDATA[visualelement]]></category>

		<guid isPermaLink="false">http://weblog.mrinalwadhwa.com/?p=894</guid>
		<description><![CDATA[<p>While working on a project yesterday I needed to convert several vectors (hundreds of them) into reusable Flex 4 visual elements that I could then use in my skins, so lets say if I have vectors of chess pieces that I would like to use in my Skin as follows &#8230;</p>
<p><img src="http://weblog.mrinalwadhwa.com/wp-content/uploads/2009/05/2009-05-08_1532.png" alt="Neat and Clean Skin code using FXG to component converter" /></p>
<p>Since I needed these in several skin files I did not want to deal with clunky Path elements which would&#8217;ve looked something like this..</p>
<p><img src="http://weblog.mrinalwadhwa.com/wp-content/uploads/2009/05/2009-05-08_1531.png" alt="Messy skin code with generated path elements" /></p>
<p>So I created a quick AIR application &#8230;. <!--more--> that that converts the elements into AS3 classes that extend from spark.primitives.Path and look something like this &#8230;</p>
<p><img src="http://weblog.mrinalwadhwa.com/wp-content/uploads/2009/05/2009-05-08_1557.png" alt="Generated Code" /></p>
<p>This way all my path data sits in one place I can use this library of visual elements in a reusable way across several applications and changing something would be really easy. Also, unlike the generated code from Flash Catalyst (Thermo) all my components are not inside Groups which are fairly heavy components.  </p>
<p>Watch this quick video of a detailed demo of how to use the tool &#8230;  </p>
<p><object type="application/x-shockwave-flash" data="http://blip.tv/scripts/flash/showplayer.swf?enablejs=true&#038;file=http%3A//blip.tv/rss/flash/2097348&#038;feedurl=http%3A//mrinalwadhwa.blip.tv/rss/&#038;autostart=false&#038;brandname=Mrinal%20Wadhwa&#038;brandlink=http%3A//mrinalwadhwa.blip.tv/" width="640" height="510" allowfullscreen="true" id="showplayer"><param name="movie" value="http://blip.tv/scripts/flash/showplayer.swf?enablejs=true&#038;file=http%3A//blip.tv/rss/flash/2097348&#038;feedurl=http%3A//mrinalwadhwa.blip.tv/rss/&#038;autostart=false&#038;brandname=Mrinal%20Wadhwa&#038;brandlink=http%3A//mrinalwadhwa.blip.tv/" /><param name="quality" value="best" /></object></p>
<p>If you think this is something useful for you to &#8230;.</p>
<h2><a href="http://fxg-to-component.googlecode.com/files/fxg-to-component-0.01.air">Download and Install</a></h2>
<p>Since I did this in very little time the code is quick and dirty but it works and is available under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache 2.0 License</a> on Google Code so feel free to to modify for your own needs. </p>
<h2><a href="http://code.google.com/p/fxg-to-component/source/browse/">View Source at Google Code</a></h2>
<p>An after thought was that this should probably not be called FXG to Component since the generated classes do not inherit from UIComponent but instead from Path which is a GraphicElement. Anyways, who cares as long as it does what its supposed to do.</p>
<p>Please do let me know if you find this useful. </p>
]]></description>
		<wfw:commentRss>http://weblog.mrinalwadhwa.com/2009/05/08/fxg-paths-to-flex-components-convertor/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>

