<?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>rialvalue.com</title>
	<atom:link href="http://www.rialvalue.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rialvalue.com/blog</link>
	<description>No Flex No Fun</description>
	<lastBuildDate>Thu, 10 Jun 2010 07:27:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Streamlining your Flex project environment</title>
		<link>http://www.rialvalue.com/blog/2010/06/10/streamlining-your-flex-project-environment/</link>
		<comments>http://www.rialvalue.com/blog/2010/06/10/streamlining-your-flex-project-environment/#comments</comments>
		<pubDate>Thu, 10 Jun 2010 07:27:31 +0000</pubDate>
		<dc:creator>Xavi Beumala</dc:creator>
				<category><![CDATA[Unit Testing]]></category>
		<category><![CDATA[best_practice]]></category>
		<category><![CDATA[components]]></category>
		<category><![CDATA[functional testing]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.rialvalue.com/blog/?p=236</guid>
		<description><![CDATA[In case you missed it, a couple of days ago an article I wrote a while ago went live in Adobe Devnet
The article summarizes a set of best practices to configure your projects on Flash Builder and Eclipse in general for maximum efficiency and reduced maintenance effort.
As a software engineer joining a new project, I [...]]]></description>
			<content:encoded><![CDATA[<p>In case you missed it, a couple of days ago an article I wrote a while ago went live in <a href="http://www.adobe.com/devnet/flex/articles/flex_streamline_project_environment.html?devcon=f1">Adobe Devnet</a></p>
<p>The article summarizes a set of best practices to configure your projects on Flash Builder and Eclipse in general for maximum efficiency and reduced maintenance effort.</p>
<blockquote><p>As a software engineer joining a new project, I want to be able to get the code quickly, build it, and then run the application. I don&#8217;t want to have to work through a complex set up procedure, read countless how-to documents, or learn the detailed ins-and-outs of the application to simply get started.</p></blockquote>
<p><a href="http://www.adobe.com/devnet/flex/articles/flex_streamline_project_environment.html?devcon=f1">You can read the article on Devnet.</a></p>
<p>Do you follow any other best practices? any tips?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rialvalue.com/blog/2010/06/10/streamlining-your-flex-project-environment/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>HowTo create your developer ToolBox with Mixins</title>
		<link>http://www.rialvalue.com/blog/2010/05/21/howto-create-your-developer-toolbox-with-mixins/</link>
		<comments>http://www.rialvalue.com/blog/2010/05/21/howto-create-your-developer-toolbox-with-mixins/#comments</comments>
		<pubDate>Fri, 21 May 2010 11:25:33 +0000</pubDate>
		<dc:creator>Xavi Beumala</dc:creator>
				<category><![CDATA[components]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[mixin]]></category>
		<category><![CDATA[toolbox]]></category>

		<guid isPermaLink="false">http://www.rialvalue.com/blog/?p=228</guid>
		<description><![CDATA[In this post I&#8217;ll explain how you can develop a flex library that automatically initializes itself avoiding developers the hassle of remembering how, when and where the libraries need to be initialized and hooked into the application. This can be particularly helpful for debugging libraries like fxSpy, DeMonsterDebugger, KaptInspect, mrdoob, etc. and extremely useful to [...]]]></description>
			<content:encoded><![CDATA[<p>In this post I&#8217;ll explain how you can develop a flex library that automatically initializes itself avoiding developers the hassle of remembering how, when and where the libraries need to be initialized and hooked into the application. This can be particularly helpful for debugging libraries like <a href="http://code.google.com/p/fxspy/">fxSpy</a>, <a href="http://demonsterdebugger.com/">DeMonsterDebugger</a>, <a href="http://lab.kapit.fr/display/kapinspect/Kap+Inspect">KaptInspect</a>, <a href="code.google.com/p/mrdoob">mrdoob</a>, etc. and extremely useful to create your own Flex toolbox that simply plugs-in and can go with you on all your developments.<br />
<span id="more-228"></span><br />
First, create a class in your library project with whatever name you pick, in my case I&#8217;ll call it LibraryInitializer.as, make sure you mark this class to be included on the final swc or even better use the new FB4 option &#8220;Include all classes from all sources&#8221;. Second and key point, add a public static method named init that receives a parameter and mark the class as a Mixin:</p>
<div class="codecolorer-container actionscript3 mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:515px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000;">&#91;</span>Mixin<span style="color: #000000;">&#93;</span><br />
<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> LibraryInitializer <br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> static <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span>systemManager<span style="color: #000066; font-weight: bold;">:</span>ISystemManager<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span> &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<span style="color: #000000;">&#125;</span></div></div>
<p>The [Mixin] metadata tag is extensively used in the Flex automation API and it basically gives you a very interesting hook. The static init method of any class marked as a [Mixin] will be invoked at a very early point during the application initialization phase by the SystemManager class or FlexModuleFactory. The Mixins are executed before the preInitialize event is triggered on the main Application. The parameter that the init method receives is a reference to the related SystemManager so you can mark the parameter as an ISystemManager, InteractiveObject or whatever better fits your needs. You can <a href="http://www.rialvalue.com/blog/2010/05/13/global-exception-or-error-handling-in-flex/">read about another interesting use of the [Mixin] on the Global Exception Handler post</a> .</p>
<p>By adding a Mixin class in a library and linking the library to an Application what you effectively get is a hook where the library can initialize itself and release the developer from manually initializing it.</p>
<p>Let&#8217;s see some real world examples.</p>
<p>Libraries like fxSpy, deMonsterDebugger, KaptInspect or mrdoob are extremely easy to use but on each project you end up doing some repetitive steps or adding conditionally compiled code to your Main application class. </p>
<p>I&#8217;ll focus on a sample with <a href="http://code.google.com/p/fxspy/">fxSpy</a> where you can launch it from a contextual option when you right click on the application and see <a href="code.google.com/p/mrdoob">mrdoob</a> memory monitor. The only step required to integrate this will is adding the following compiler option:</p>
<div class="codecolorer-container text mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:515px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">-include-libraries=libs/myToolbox.swc</div></div>
<p>And this is the library initializer, which basically adds a ContextMenuItem to the contextMenu of the systemManager. Note that we have to wait for the APPLICATION_COMPLETE event, otherwise the Flex SDK will override our contextMenu (it happens on the pre-initialize phase).</p>
<div class="codecolorer-container actionscript3 mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:515px;height:330px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #9900cc; font-weight: bold;">package</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> com<span style="color: #000066; font-weight: bold;">.</span>flexspy<span style="color: #000066; font-weight: bold;">.</span>FlexSpy<span style="color: #000066; font-weight: bold;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=interactiveobject%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:interactiveobject.html"><span style="color: #004993;">InteractiveObject</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=contextmenuevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:contextmenuevent.html"><span style="color: #004993;">ContextMenuEvent</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=event%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:event.html"><span style="color: #004993;">Event</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.ui</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=contextmenu%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:contextmenu.html"><span style="color: #004993;">ContextMenu</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.ui</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=contextmenuitem%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:contextmenuitem.html"><span style="color: #004993;">ContextMenuItem</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> flashx<span style="color: #000066; font-weight: bold;">.</span>textLayout<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">elements</span><span style="color: #000066; font-weight: bold;">.</span>GlobalSettings<span style="color: #000066; font-weight: bold;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>core<span style="color: #000066; font-weight: bold;">.</span>FlexGlobals<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>events<span style="color: #000066; font-weight: bold;">.</span>FlexEvent<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>managers<span style="color: #000066; font-weight: bold;">.</span>ISystemManager<span style="color: #000066; font-weight: bold;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> spark<span style="color: #000066; font-weight: bold;">.</span>core<span style="color: #000066; font-weight: bold;">.</span>SpriteVisualElement<span style="color: #000066; font-weight: bold;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000;">&#91;</span>Mixin<span style="color: #000000;">&#93;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> MyToolBoxInitializer<br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">private</span> static <span style="color: #6699cc; font-weight: bold;">var</span> initializer<span style="color: #000066; font-weight: bold;">:</span>MyToolBoxInitializer<span style="color: #000066; font-weight: bold;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> static <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span>systemManager<span style="color: #000066; font-weight: bold;">:</span>ISystemManager<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; systemManager<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>FlexEvent<span style="color: #000066; font-weight: bold;">.</span>APPLICATION_COMPLETE<span style="color: #000066; font-weight: bold;">,</span> applicationCompleteHandler<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">private</span> static <span style="color: #339966; font-weight: bold;">function</span> applicationCompleteHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=event%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:event.html"><span style="color: #004993;">Event</span></a><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> systemManager<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=interactiveobject%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:interactiveobject.html"><span style="color: #004993;">InteractiveObject</span></a> = event<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">target</span> <span style="color: #0033ff; font-weight: bold;">as</span> <a href="http://www.google.com/search?q=interactiveobject%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:interactiveobject.html"><span style="color: #004993;">InteractiveObject</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; systemManager<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span>FlexEvent<span style="color: #000066; font-weight: bold;">.</span>APPLICATION_COMPLETE<span style="color: #000066; font-weight: bold;">,</span> applicationCompleteHandler<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; initializer = <span style="color: #0033ff; font-weight: bold;">new</span> MyToolBoxInitializer<span style="color: #000000;">&#40;</span>systemManager<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> MyToolBoxInitializer<span style="color: #000000;">&#40;</span><span style="color: #004993;">target</span><span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=interactiveobject%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:interactiveobject.html"><span style="color: #004993;">InteractiveObject</span></a><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; createContextMenu<span style="color: #000000;">&#40;</span><span style="color: #004993;">target</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; createMonitor<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> createContextMenu<span style="color: #000000;">&#40;</span><span style="color: #004993;">target</span><span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=interactiveobject%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:interactiveobject.html"><span style="color: #004993;">InteractiveObject</span></a><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">contextMenu</span><span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=contextmenu%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:contextmenu.html"><span style="color: #004993;">ContextMenu</span></a> = <span style="color: #004993;">target</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">contextMenu</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">contextMenu</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">customItems</span> = <span style="color: #000000;">&#91;</span> createContextMenuItem<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> createMonitor<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> sve<span style="color: #000066; font-weight: bold;">:</span>SpriteVisualElement = <span style="color: #0033ff; font-weight: bold;">new</span> SpriteVisualElement<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sve<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> Stats<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FlexGlobals<span style="color: #000066; font-weight: bold;">.</span>topLevelApplication<span style="color: #000066; font-weight: bold;">.</span>addElement<span style="color: #000000;">&#40;</span>sve<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> createContextMenuItem<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=contextmenuitem%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:contextmenuitem.html"><span style="color: #004993;">ContextMenuItem</span></a><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> contextItem<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=contextmenuitem%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:contextmenuitem.html"><span style="color: #004993;">ContextMenuItem</span></a> = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=contextmenuitem%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:contextmenuitem.html"><span style="color: #004993;">ContextMenuItem</span></a><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;Flex Spy&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; contextItem<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?q=contextmenuevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:contextmenuevent.html"><span style="color: #004993;">ContextMenuEvent</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">MENU_ITEM_SELECT</span><span style="color: #000066; font-weight: bold;">,</span> handleContextMenuItemSelect<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">return</span> contextItem<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> handleContextMenuItemSelect<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=event%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:event.html"><span style="color: #004993;">Event</span></a><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FlexSpy<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">show</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<span style="color: #000000;">&#125;</span></div></div>
<p>In the Initializer you could also intialize the fps and memory monitor provided by mrdoob by simply adding a new instance to the DisplayList.</p>
<p>These are the benefits I see on this approach:</p>
<ul>
<li>You won&#8217;t have to reapeat yourself in different projects initializing the same libraries always in the same way.</li>
<li>Your main file won&#8217;t be cluttered with infrastructure and glue code to configure your libraries.</li>
<li>You won&#8217;t need to use conditional compilation for this initializations. You can enable or disable all at once by removing the compiler option. Going an step further you could have diferent compiler profiles / environments on your ant tasks or maven builds or even use the -load-config compiler option to externalize your configurations to an xml file.</li>
</ul>
<p><a href="http://www.rialvalue.com/downloads/libraryInitializers.zip">You can downdload a zip with 2 sample projects</a>, one for the library and the other for the application using it.</p>
<p>Shortly I&#8217;ll blog about some of the things I have in my toolbox that could be helpful for you too.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rialvalue.com/blog/2010/05/21/howto-create-your-developer-toolbox-with-mixins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Global Exception or Error Handling in Flex</title>
		<link>http://www.rialvalue.com/blog/2010/05/13/global-exception-or-error-handling-in-flex/</link>
		<comments>http://www.rialvalue.com/blog/2010/05/13/global-exception-or-error-handling-in-flex/#comments</comments>
		<pubDate>Thu, 13 May 2010 09:08:52 +0000</pubDate>
		<dc:creator>Xavi Beumala</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[components]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[error handling]]></category>
		<category><![CDATA[mixin]]></category>

		<guid isPermaLink="false">http://www.rialvalue.com/blog/?p=207</guid>
		<description><![CDATA[In this post I explain how you can catch unhandled exceptions or errors globally in a declarative mxml-based way using the [Mixin] flex-specific metadata tag.
Starting on FP 10.1 and AIR 2.0 you can capture unhandled exceptions or errors globally. Although you can use these new APIs you should always take care of the exceptions where [...]]]></description>
			<content:encoded><![CDATA[<p>In this post I explain how you can catch unhandled exceptions or errors globally in a declarative mxml-based way using the [Mixin] flex-specific metadata tag.</p>
<p>Starting on FP 10.1 and AIR 2.0 you can capture unhandled exceptions or errors globally. Although you can use these new APIs you should <b>always</b> take care of the exceptions where they happen and use this technique only as a diagnosing or logging help or for async exceptions that you can&#8217;t really control in any other way. </p>
<p>You might also be interested in these 2 other topics:</p>
<ul>
<li><a href="http://www.rialvalue.com/blog/2009/08/25/logging-and-catching-exceptions-during-invalidation/">Logging and catching (async) exceptions during invalidation in Flex</a></li>
<li><a href="http://www.rialvalue.com/blog/2009/08/16/debugging-production-ready-air-applications/">Debugging and getting Stack-trace error dialogs with installed AIR applications</a></li>
</ul>
<p>The new API works like:</p>
<div class="codecolorer-container actionscript3 mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:515px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #004993;">loaderInfo</span><span style="color: #000066; font-weight: bold;">.</span>uncaughtErrorEvents<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>UncaughtErrorEvent<span style="color: #000066; font-weight: bold;">.</span>UNCAUGHT_ERROR<span style="color: #000066; font-weight: bold;">,</span> onUncaughtError<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
<br />
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> onUncaughtError<span style="color: #000000;">&#40;</span>e<span style="color: #000066; font-weight: bold;">:</span>UncaughtErrorEvent<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// Do something with your error.</span><br />
<span style="color: #000000;">&#125;</span></div></div>
<p><a href="http://blogs.adobe.com/cantrell/archives/2009/10/global_error_handling_in_air_20.html">Christian Cantrell explains some more details on the APIs</a>. You can find further information <a href="http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/flash/events/UncaughtErrorEvent.html">in the documentation</a> as well.</p>
<p>When working with Flex, and adding the UncaughtErrorEvent.UNCAUGHT_ERROR listener to the loaderInfo object make sure you do it after FlexEvent.APPLICATION_COMPLETE event has been triggered, otherwise you&#8217;ll get an &#8220;Error #1009: Cannot access a property or method of a null object reference&#8221;</p>
<p>To prevent all this required glue code and avoid unnecessary configuration code (that ends up cluttering the main application Class) I&#8217;ve created a GlobalExceptionHandler component that abstracts developers a little bit from these sort of problems. The implementation isn&#8217;t tighted to the APPLICATION_COMPLETE event, instead it uses the [Mixin] metadata tag. On top of that you can use it declaratively:</p>
<div class="codecolorer-container xml mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:515px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:WindowedApplication</span> <span style="color: #000066;">xmlns:fx</span>=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">xmlns:s</span>=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">xmlns:mx</span>=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/mx&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">xmlns:logging</span>=<span style="color: #ff0000;">&quot;com.adobe.ac.logging.*&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fx:Declarations<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;logging:GlobalExceptionHandler</span> <span style="color: #000066;">preventDefault</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;logging:LogHandlerAction</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;local:TraceHandlerAction</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/logging:GlobalExceptionHandler<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fx:Declarations<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:WindowedApplication<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>You can <a href="http://www.rialvalue.com/downloads/globalExceptionHandler.zip">download the code along with a sample project here</a>. The code for GlobalExceptionHandler:</p>
<div class="codecolorer-container actionscript3 mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:515px;height:330px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #9900cc; font-weight: bold;">package</span> com<span style="color: #000066; font-weight: bold;">.</span>adobe<span style="color: #000066; font-weight: bold;">.</span>ac<span style="color: #000066; font-weight: bold;">.</span>logging<br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=loaderinfo%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:loaderinfo.html"><span style="color: #004993;">LoaderInfo</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span><span style="color: #000066; font-weight: bold;">.</span>UncaughtErrorEvent<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>managers<span style="color: #000066; font-weight: bold;">.</span>ISystemManager<span style="color: #000066; font-weight: bold;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000;">&#91;</span>Mixin<span style="color: #000000;">&#93;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#91;</span>DefaultProperty<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;handlerActions&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> GlobalExceptionHandler<br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">private</span> static <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">loaderInfo</span><span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=loaderinfo%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:loaderinfo.html"><span style="color: #004993;">LoaderInfo</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span>ArrayElementType<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;com.adobe.ac.logging.GlobalExceptionHandlerAction&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> handlerActions<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=array%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:array.html"><span style="color: #004993;">Array</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">preventDefault</span><span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=boolean%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:boolean.html"><span style="color: #004993;">Boolean</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> static <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span>sm<span style="color: #000066; font-weight: bold;">:</span>ISystemManager<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">loaderInfo</span> = sm<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">loaderInfo</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> GlobalExceptionHandler<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">loaderInfo</span><span style="color: #000066; font-weight: bold;">.</span>uncaughtErrorEvents<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>UncaughtErrorEvent<span style="color: #000066; font-weight: bold;">.</span>UNCAUGHT_ERROR<span style="color: #000066; font-weight: bold;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; uncaughtErrorHandler<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> uncaughtErrorHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span>UncaughtErrorEvent<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #0033ff; font-weight: bold;">each</span> <span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> action<span style="color: #000066; font-weight: bold;">:</span>GlobalExceptionHandlerAction <span style="color: #0033ff; font-weight: bold;">in</span> handlerActions<span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; action<span style="color: #000066; font-weight: bold;">.</span>handle<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">error</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">preventDefault</span> == <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; event<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">preventDefault</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<span style="color: #000000;">&#125;</span></div></div>
<p>The code for LogHandlerAction:</p>
<div class="codecolorer-container actionscript3 mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:515px;height:330px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #9900cc; font-weight: bold;">package</span> com<span style="color: #000066; font-weight: bold;">.</span>adobe<span style="color: #000066; font-weight: bold;">.</span>ac<span style="color: #000066; font-weight: bold;">.</span>logging<br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>logging<span style="color: #000066; font-weight: bold;">.</span>ILogger<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>logging<span style="color: #000066; font-weight: bold;">.</span>Log<span style="color: #000066; font-weight: bold;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> LogHandlerAction implements GlobalExceptionHandlerAction<br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">private</span> static const LOG<span style="color: #000066; font-weight: bold;">:</span>ILogger = Log<span style="color: #000066; font-weight: bold;">.</span>getLogger<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;UncaughtException&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> handle<span style="color: #000000;">&#40;</span><span style="color: #004993;">error</span><span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=object%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:object.html"><span style="color: #004993;">Object</span></a><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">error</span> <span style="color: #0033ff; font-weight: bold;">is</span> <a href="http://www.google.com/search?q=error%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:error.html"><span style="color: #004993;">Error</span></a><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> errorObj<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=error%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:error.html"><span style="color: #004993;">Error</span></a> = <span style="color: #004993;">error</span> <span style="color: #0033ff; font-weight: bold;">as</span> <a href="http://www.google.com/search?q=error%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:error.html"><span style="color: #004993;">Error</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LOG<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">error</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;{0}. {1}<span style="">\n</span> {2}&quot;</span><span style="color: #000066; font-weight: bold;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; errorObj<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">errorID</span><span style="color: #000066; font-weight: bold;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; errorObj<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">message</span><span style="color: #000066; font-weight: bold;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; errorObj<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">getStackTrace</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<span style="color: #000000;">&#125;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.rialvalue.com/blog/2010/05/13/global-exception-or-error-handling-in-flex/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Properties file based configuration mechanism for Parsley</title>
		<link>http://www.rialvalue.com/blog/2010/05/12/properties-file-based-configuration-mechanism-for-parsley/</link>
		<comments>http://www.rialvalue.com/blog/2010/05/12/properties-file-based-configuration-mechanism-for-parsley/#comments</comments>
		<pubDate>Wed, 12 May 2010 19:23:45 +0000</pubDate>
		<dc:creator>Xavi Beumala</dc:creator>
				<category><![CDATA[architecture]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[parsley]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.rialvalue.com/blog/?p=204</guid>
		<description><![CDATA[In this post I introduce a new mechanism for Parsley to load part of a Context from a properties file. This way highly dynamic of changing properties can be managed externally from the properties file, avoiding the verbosity of an XML approach. As always, the source code is attached.
One of the things I like a [...]]]></description>
			<content:encoded><![CDATA[<p>In this post I introduce a new mechanism for Parsley to load part of a Context from a properties file. This way highly dynamic of changing properties can be managed externally from the properties file, avoiding the verbosity of an XML approach. As always, <a href="http://www.rialvalue.com/downloads/parsleyPropertiesProcessor.zip">the source code is attached</a>.</p>
<p>One of the things I like a lot about Parsley are all its extenstion points and available hooks to extends its native functionalities or default behaviours. In these regards a very useful extension point is, <a href="http://blogs.adobe.com/tomsugden/2010/02/the_flexible_configuration_opt.html#more">Tom explained a while ago</a>, the different configuration mechanisms.</p>
<p><a href="http://www.spicefactory.org/parsley/docs/2.2/manual/config.php#combine">As explained in the documentation</a> you can use a combined configuration mechanism to separate more dynamic or change-prone definitions from the more static ones. You could use an XML-based context defintion for the former and an MXML-based context definition for the latter.</p>
<p>While the XML-based context definition might work in most of the cases it might not be the best solution in some scenarios due to its verbosity.</p>
<p>Imagine I have an AIR2 based application which creates an HTTPServer instance. The server instance is created an managed by a Parsley Context:</p>
<div class="codecolorer-container xml mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:515px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;spicefactory:Object</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;httpServer&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;{HTTPServerImpl}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;spicefactory:ConstructorArgs<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;spicefactory:NestedObject</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;{RequestProcessorFactory}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fx:Number<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>5000<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fx:Number<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fx:String<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>0.0.0.0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fx:String<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/spicefactory:ConstructorArgs<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/spicefactory:Object<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>The second constructor parameter, 5000, is the port the server will be listening to and the third-one, 0.0.0.0, is the network interface where the server will be binded to.<br />
These 2 parameters are potentially prone to change whereas the rest of the definition will be very static and rarely change. In my case these parameters should be configurable and maintained by IT administrators or even final users.</p>
<p>Moving this definition to a runtime configuration mechanism seems like the right thing. The main problem of moving this into an XML-based context is that it&#8217;d be too verbose and meaningless to the the targeted users who should maitain and drive the changes, thus making the configuration system of the application too weak and error-prone while exposing things that shouldn&#8217;t be changed (at least by these users).</p>
<p>What I would like to do is define in a more static way the server creation instance, making it safer to undesired configurations, but make more dynamic some of its arguments:</p>
<div class="codecolorer-container xml mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:515px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;spicefactory:Object</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;httpServer&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;{HTTPServerImpl}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;spicefactory:ConstructorArgs<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;spicefactory:NestedObject</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;{RequestProcessorFactory}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;spicefactory:ObjectRef</span> <span style="color: #000066;">idRef</span>=<span style="color: #ff0000;">&quot;port&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;spicefactory:ObjectRef</span> <span style="color: #000066;">idRef</span>=<span style="color: #ff0000;">&quot;host&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/spicefactory:ConstructorArgs<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/spicefactory:Object<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>Then we could define the <b>port</b> and <b>host</b> parameters using any other mechanism.</p>
<p>My approach has been to create a properties file based configuation. I create config.properties like:</p>
<div class="codecolorer-container actionscript3 mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:515px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">port=<span style="color: #000000; font-weight:bold;">5000</span><br />
host=0<span style="color: #000066; font-weight: bold;">.</span>0<span style="color: #000066; font-weight: bold;">.</span>0<span style="color: #000066; font-weight: bold;">.</span>0</div></div>
<p>And then the following combined configuration mechanism:</p>
<div class="codecolorer-container xml mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:515px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;spicefactory:ContextBuilder<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;spicefactory:FlexConfig</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;{ CommonConfiguration }&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;processor:PropertiesConfig</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;data/config.properties&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/spicefactory:ContextBuilder<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>This way the Parsley Context is built using an standard mxml approach together with a properties file based configuation. The PropertiesConfig implementation uses ContextBuilderProcessor and AsyncConfigurationProcessor extensions, load and parse the specified properties file and inject the property definitions into the context as simple strings. These definitions can then be used elsewhere normally.</p>
<p>You can find attached the entire implementation. Note that I implemented this against trunk (v.2.3.M1-snapshot) so it might not work out-of-the-box for other versions.</p>
<p>This technique could be used in a wide range of scenarios. You could define RemoteObjects and ChannelSet in an MXML compiled configuration file but inject from a properties file the  url of the Channel. i.e.</p>
<div class="codecolorer-container xml mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:515px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;spicefactory:Object</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;amfChannel&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;{AMFChannel}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;spicefactory:Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;uri&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;spicefactory:ObjectRef</span> <span style="color: #000066;">idRef</span>=<span style="color: #ff0000;">&quot;amfChannelUri&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/spicefactory:Property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/spicefactory:Object<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>In the config.properties:</p>
<div class="codecolorer-container actionscript3 mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:515px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">amfChannelUri=http<span style="color: #000066; font-weight: bold;">:</span><span style="color: #009900; font-style: italic;">//my.domain.com/messagebroker</span></div></div>
<p>And the declare the ContextBuilder as:</p>
<div class="codecolorer-container xml mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:515px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;spicefactory:ContextBuilder<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;spicefactory:FlexConfig</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;{ CommonConfiguration }&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;processor:PropertiesConfig</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;data/config.properties&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/spicefactory:ContextBuilder<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>Note, as suggested by Jens, that there might be scenarios where a tag like ObjectRef is not a good fit (like when using some of the built-in Flex tags like mx:RemoteObject). Being able to use a plain Flex binding on a simple MXML attribute might be a nice alternative to having &#8220;heavyweight&#8221; top-level String objects.<br />
Other very intersting ways to achieve this same behaviour suggested by Jens (all kudos to him):</p>
<p>1. Use XML Configuration declaring strings like:</p>
<div class="codecolorer-container xml mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:515px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;object</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;host&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;String&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;constructor-args<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>0.0.0.0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/constructor-args<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/object<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>2. Create a custom tag that does the above in a more concise syntax using the Spicelib XML-Object-Mapper and a Parsley XMLConfigurationNamespace. You can see an example of this approach in Cairngorm3 Module library</p>
<div class="codecolorer-container xml mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:515px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;custom:property</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;host&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;0.0.0.0&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></div>
<p>3. Use the approach of an Environment class holding these values in the XML file, but use a custom <PropertyRef> tag in MXML:</p>
<div class="codecolorer-container xml mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:515px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;spicefactory:ConstructorArgs<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;spicefactory:NestedObject</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;{RequestProcessorFactory}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;custom:PropertyRef</span> <span style="color: #000066;">idRef</span>=<span style="color: #ff0000;">&quot;environment&quot;</span> <span style="color: #000066;">property</span>=<span style="color: #ff0000;">&quot;port&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span> <br />
&nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;custom:PropertyRef</span> <span style="color: #000066;">idRef</span>=<span style="color: #ff0000;">&quot;environment&quot;</span> <span style="color: #000066;">property</span>=<span style="color: #ff0000;">&quot;host&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/spicefactory:ConstrunctorArgs<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>The PropertyRef tag would require a bit of work (and it would be different for Parsley 2.2 and 2.3 due to some changes in internal APIs.</p>
<p><a href="http://www.rialvalue.com/downloads/parsleyPropertiesProcessor.zip">Download PropertiesConfig for Parsley.</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rialvalue.com/blog/2010/05/12/properties-file-based-configuration-mechanism-for-parsley/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>String Templating in Flex</title>
		<link>http://www.rialvalue.com/blog/2010/05/10/string-templating-in-flex/</link>
		<comments>http://www.rialvalue.com/blog/2010/05/10/string-templating-in-flex/#comments</comments>
		<pubDate>Mon, 10 May 2010 09:51:29 +0000</pubDate>
		<dc:creator>Xavi Beumala</dc:creator>
				<category><![CDATA[architecture]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.rialvalue.com/blog/?p=199</guid>
		<description><![CDATA[When working with String templates, code can easily become quite difficult to read and, consequently, to understand, maintain and modify. This blog post explains 2 techniques that can help you dealing with String concatenation and templating: StringUtil.substitue and [Embed] compiler directive.
For simple String concatenation like:
var value : String = &#34;The value &#34; + user + [...]]]></description>
			<content:encoded><![CDATA[<p>When working with String templates, code can easily become quite difficult to read and, consequently, to understand, maintain and modify. This blog post explains 2 techniques that can help you dealing with String concatenation and templating: StringUtil.substitue and [Embed] compiler directive.</p>
<p>For simple String concatenation like:</p>
<div class="codecolorer-container actionscript3 mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:515px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">value</span> <span style="color: #000066; font-weight: bold;">:</span> <a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a> = <span style="color: #990000;">&quot;The value &quot;</span> <span style="color: #000066; font-weight: bold;">+</span> user <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #990000;">&quot; requested is <span style="">\&quot;</span>&quot;</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #004993;">value</span> <span style="color: #990000;">&quot;<span style="">\&quot;</span>&quot;</span><span style="color: #000066; font-weight: bold;">;</span></div></div>
<p>You can alwayus use StringUtil.substitue, which will help you having a wider vision of the message being built:</p>
<div class="codecolorer-container actionscript3 mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:515px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>utils<span style="color: #000066; font-weight: bold;">.</span>StringUtil<span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">value</span> <span style="color: #000066; font-weight: bold;">:</span> <a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a> = StringUtil<span style="color: #000066; font-weight: bold;">.</span>substitute<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;The value {0} requested is <span style="">\&quot;</span>{1}<span style="">\&quot;</span>&quot;</span><span style="color: #000066; font-weight: bold;">,</span> user<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">value</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div></div>
<p>When creating multi-line Strings, things can easily get uglier:</p>
<div class="codecolorer-container actionscript3 mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:515px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6699cc; font-weight: bold;">var</span> errorCode<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #6699cc; font-weight: bold;">var</span> errorString<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #6699cc; font-weight: bold;">var</span> errorMessage<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
<br />
<span style="color: #6699cc; font-weight: bold;">var</span> str<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a> = <span style="color: #990000;">&quot;&lt;!DOCTYPE HTML PUBLIC <span style="">\&quot;</span>-//IETF//DTD HTML 2.0//EN<span style="">\&quot;</span>&gt;<span style="">\n</span>&quot;</span><br />
str <span style="color: #000066; font-weight: bold;">+</span>= <span style="color: #990000;">&quot;&lt;html&gt;&lt;head&gt;<span style="">\n</span>&quot;</span><span style="color: #000066; font-weight: bold;">;</span><br />
str <span style="color: #000066; font-weight: bold;">+</span>= <span style="color: #990000;">&quot;&lt;title&gt;&quot;</span> <span style="color: #000066; font-weight: bold;">+</span> errorCode <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #990000;">&quot; &quot;</span> <span style="color: #000066; font-weight: bold;">+</span> errorString <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #990000;">&quot;&lt;/title&gt;<span style="">\n</span>&quot;</span><br />
str <span style="color: #000066; font-weight: bold;">+</span>= <span style="color: #990000;">&quot;&lt;/head&gt;&lt;body&gt;<span style="">\n</span>&quot;</span><span style="color: #000066; font-weight: bold;">;</span><br />
str <span style="color: #000066; font-weight: bold;">+</span>= <span style="color: #990000;">&quot;&lt;h1&gt;&quot;</span> <span style="color: #000066; font-weight: bold;">+</span> errorCode <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #990000;">&quot;&lt;/h1&gt;<span style="">\n</span>&quot;</span><span style="color: #000066; font-weight: bold;">;</span><br />
str <span style="color: #000066; font-weight: bold;">+</span>= <span style="color: #990000;">&quot;&lt;p&gt;&quot;</span> <span style="color: #000066; font-weight: bold;">+</span> errorMessage <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #990000;">&quot;&lt;/p&gt;<span style="">\n</span>&quot;</span><span style="color: #000066; font-weight: bold;">;</span><br />
str <span style="color: #000066; font-weight: bold;">+</span>= <span style="color: #990000;">&quot;&lt;/body&gt;&lt;/html&gt;&quot;</span><span style="color: #000066; font-weight: bold;">;</span></div></div>
<p>Not to say that this could get worse. A way to make it a little bit more readable would be using the StringUtil substitution technique:</p>
<div class="codecolorer-container actionscript3 mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:515px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6699cc; font-weight: bold;">var</span> str<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a> = <span style="color: #990000;">&quot;&lt;!DOCTYPE HTML PUBLIC <span style="">\&quot;</span>-//IETF//DTD HTML 2.0//EN<span style="">\&quot;</span>&gt;<span style="">\n</span>&quot;</span><br />
str <span style="color: #000066; font-weight: bold;">+</span>= <span style="color: #990000;">&quot;&lt;html&gt;&lt;head&gt;<span style="">\n</span>&quot;</span><span style="color: #000066; font-weight: bold;">;</span><br />
str <span style="color: #000066; font-weight: bold;">+</span>= <span style="color: #990000;">&quot;&lt;title&gt;{0}{1}&lt;/title&gt;<span style="">\n</span>&quot;</span><br />
str <span style="color: #000066; font-weight: bold;">+</span>= <span style="color: #990000;">&quot;&lt;/head&gt;&lt;body&gt;<span style="">\n</span>&quot;</span><span style="color: #000066; font-weight: bold;">;</span><br />
str <span style="color: #000066; font-weight: bold;">+</span>= <span style="color: #990000;">&quot;&lt;h1&gt;{0}&lt;/h1&gt;<span style="">\n</span>&quot;</span><span style="color: #000066; font-weight: bold;">;</span><br />
str <span style="color: #000066; font-weight: bold;">+</span>= <span style="color: #990000;">&quot;&lt;p&gt;{2}&lt;/p&gt;<span style="">\n</span>&quot;</span><span style="color: #000066; font-weight: bold;">;</span><br />
str <span style="color: #000066; font-weight: bold;">+</span>= <span style="color: #990000;">&quot;&lt;/body&gt;&lt;/html&gt;&quot;</span><span style="color: #000066; font-weight: bold;">;</span><br />
<br />
StringUtil<span style="color: #000066; font-weight: bold;">.</span>substitute<span style="color: #000000;">&#40;</span> str<span style="color: #000066; font-weight: bold;">,</span> errorCode<span style="color: #000066; font-weight: bold;">,</span> errorString<span style="color: #000066; font-weight: bold;">,</span> errorMessage<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div></div>
<p>The problem with this is that there&#8217;s still too much infrastructure to create the base template and it&#8217;s difficult, at first sight, to see where are the substitution tokens. On the other hand, the templated text by itself might not have that much relevance in the code and might distract developers from other imporntant things.</p>
<p>A nice way to achieve the same result consists in externalizing the template to a text file and get some help from the compiler:</p>
<div class="codecolorer-container actionscript3 mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:515px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000;">&#91;</span>Embed<span style="color: #000000;">&#40;</span><span style="color: #004993;">source</span>=<span style="color: #990000;">&quot;yourTemplate.txt&quot;</span><span style="color: #000066; font-weight: bold;">,</span> mimeType=<span style="color: #990000;">&quot;application/octet-stream&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><br />
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> templateDefinition <span style="color: #000066; font-weight: bold;">:</span> <a href="http://www.google.com/search?q=class%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:class.html"><span style="color: #004993;">Class</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
<br />
StringUtil<span style="color: #000066; font-weight: bold;">.</span>substitute<span style="color: #000000;">&#40;</span> <span style="color: #0033ff; font-weight: bold;">new</span> templateDefinition<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">,</span> errorCode<span style="color: #000066; font-weight: bold;">,</span> errorString<span style="color: #000066; font-weight: bold;">,</span> errorMessage<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div></div>
<p>Where yourTemplate.txt is a simple text file with the template itself:</p>
<div class="codecolorer-container actionscript3 mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:515px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000066; font-weight: bold;">&lt;!</span>DOCTYPE HTML PUBLIC <span style="color: #990000;">&quot;-//IETF//DTD HTML 2.0//EN&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span><br />
<span style="color: #000066; font-weight: bold;">&lt;</span>html<span style="color: #000066; font-weight: bold;">&gt;&lt;</span>head<span style="color: #000066; font-weight: bold;">&gt;</span><br />
<span style="color: #000066; font-weight: bold;">&lt;</span>title<span style="color: #000066; font-weight: bold;">&gt;</span><span style="color: #000000;">&#123;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#123;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#125;</span><span style="color: #000066; font-weight: bold;">&lt;/</span>title<span style="color: #000066; font-weight: bold;">&gt;</span><br />
<span style="color: #000066; font-weight: bold;">&lt;/</span>head<span style="color: #000066; font-weight: bold;">&gt;&lt;</span>body<span style="color: #000066; font-weight: bold;">&gt;</span><br />
<span style="color: #000066; font-weight: bold;">&lt;</span>h1<span style="color: #000066; font-weight: bold;">&gt;</span><span style="color: #000000;">&#123;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#125;</span><span style="color: #000066; font-weight: bold;">&lt;/</span>h1<span style="color: #000066; font-weight: bold;">&gt;</span><br />
<span style="color: #000066; font-weight: bold;">&lt;</span>p<span style="color: #000066; font-weight: bold;">&gt;</span><span style="color: #000000;">&#123;</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000000;">&#125;</span><span style="color: #000066; font-weight: bold;">&lt;/</span>p<span style="color: #000066; font-weight: bold;">&gt;</span><br />
<span style="color: #000066; font-weight: bold;">&lt;/</span>body<span style="color: #000066; font-weight: bold;">&gt;&lt;/</span>html<span style="color: #000066; font-weight: bold;">&gt;</span></div></div>
<p>Note that using the [Embed] metadata instructs the compiler to link the file content at compile time, making our code completely synchronous.</p>
<p>Also note that we&#8217;re substituting the parameters using the order, it&#8217;d would fairly easy to do a named-parameter subsitution instead (i.e. using tokens like ${var1})</p>
<p>Finally, in MXML you can use this other technique to compile an external text file:</p>
<div class="codecolorer-container actionscript3 mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:515px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000066; font-weight: bold;">&lt;</span>fx<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a> id=<span style="color: #990000;">&quot;template&quot;</span> <span style="color: #004993;">source</span>=<span style="color: #990000;">&quot;path/to/your/template.txt&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.rialvalue.com/blog/2010/05/10/string-templating-in-flex/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>DualPanel Reversible Component</title>
		<link>http://www.rialvalue.com/blog/2010/05/05/dualpanel-reversible-component/</link>
		<comments>http://www.rialvalue.com/blog/2010/05/05/dualpanel-reversible-component/#comments</comments>
		<pubDate>Wed, 05 May 2010 17:01:44 +0000</pubDate>
		<dc:creator>Xavi Beumala</dc:creator>
				<category><![CDATA[architecture]]></category>
		<category><![CDATA[components]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.rialvalue.com/blog/?p=173</guid>
		<description><![CDATA[This week I&#8217;ve been discussing with Alberto from undefined.es different ways to implement a reversible panel. Basically a reversible panel would be a 2-sides panel. In the front part you could have the component or widget and in the back you could have a configuration panel (same concept as in the OSX Dashboard widgets).
One way [...]]]></description>
			<content:encoded><![CDATA[<p>This week I&#8217;ve been discussing with Alberto from <a href="http://www.undefined.es">undefined.es</a> different ways to implement a reversible panel. Basically a reversible panel would be a 2-sides panel. In the front part you could have the component or widget and in the back you could have a configuration panel (same concept as in the OSX Dashboard widgets).</p>
<p>One way to implement it, would be as an extended concept of <a href="http://www.rialvalue.com/blog/2010/05/05">a template component as explained in my previous post</a>. It would basically be a template component with 2 customizable areas: the frontView and the backView. As a developer I&#8217;d then use it like:</p>
<div class="codecolorer-container actionscript3 mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:515px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000066; font-weight: bold;">&lt;</span>dualpanel<span style="color: #000066; font-weight: bold;">:</span>DualPanel <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;200&quot;</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;200&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; transitionDuration=<span style="color: #990000;">&quot;200&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">&lt;</span>dualpanel<span style="color: #000066; font-weight: bold;">:</span>frontView<span style="color: #000066; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">&lt;</span>local<span style="color: #000066; font-weight: bold;">:</span>SampleComponent <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;100%&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">backgroundColor</span>=<span style="color: #990000;">&quot;0x000000&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; label=<span style="color: #990000;">&quot;Front&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">&lt;/</span>dualpanel<span style="color: #000066; font-weight: bold;">:</span>frontView<span style="color: #000066; font-weight: bold;">&gt;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">&lt;</span>dualpanel<span style="color: #000066; font-weight: bold;">:</span>backView<span style="color: #000066; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">&lt;</span>local<span style="color: #000066; font-weight: bold;">:</span>SampleComponent <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;100%&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">backgroundColor</span>=<span style="color: #990000;">&quot;0x999999&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; label=<span style="color: #990000;">&quot;Back&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">&lt;/</span>dualpanel<span style="color: #000066; font-weight: bold;">:</span>backView<span style="color: #000066; font-weight: bold;">&gt;</span><br />
<span style="color: #000066; font-weight: bold;">&lt;/</span>dualpanel<span style="color: #000066; font-weight: bold;">:</span>DualPanel<span style="color: #000066; font-weight: bold;">&gt;</span></div></div>
<p>The interesting thing about this component is that there&#8217;re a bunch of different ways to present 2 panels and to transition between them i.e. flip, wipe, zoom, etc. If we encapsulate the logic of having 2 areas or content holders we can extract the presentation or view customizations into skins. </p>
<p><a href="http://www.rialvalue.com/components/dualpanel/">See sample fullScreen</a><br />
<a href="http://www.rialvalue.com/components/dualpanel/srcview">Browse code.</a></p>
<p>The component is implemented using states, although it could be implemented without using states to prevent the views to be mutually exclusive, the base idea would be essentially the same: define contentHolders where we addElements set in certain properties.</p>
<p>A very interesting feature we still to add is deferred instantiation of the frontView and backView. By typing frontView and backView as IDeferredInstance will prevent the application from paying the cost of initializing the views until the user actually wants to see them. This means that if the user doesn&#8217;t click on the button the back view won&#8217;t be instantiated. </p>
<p>
<object width="525" height="350">
<param name="movie" value="http://www.rialvalue.com/components/deferreddualpanel/Main.swf" />
<param name="quality" value="high" />
<param name="wmode" value="window" />
<param name="menu" value="false" />
<param name="bgcolor" value="#FFFFFF" />
<param name="allowFullScreen" value="true"></param>
<embed type="application/x-shockwave-flash" width="525" height="350" src="http://www.rialvalue.com/components/deferreddualpanel/Main.swf" quality="high" bgcolor="#FFFFFF" wmode="window" menu="false" allowFullScreen="true" ></embed>
</object>
</p>
<p><a href="http://www.rialvalue.com/components/deferreddualpanel/">See sample fullScreen</a><br />
<a href="http://www.rialvalue.com/components/deferreddualpanel/srcview">Browse code.</a></p>
<p>If you use this component make sure you grab the one with deferred instantiation.</p>
<p>This is just a proof of concept and the code might have some problems. You can use it at your own risk.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rialvalue.com/blog/2010/05/05/dualpanel-reversible-component/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Template Components in Flex4</title>
		<link>http://www.rialvalue.com/blog/2010/05/05/template-components-in-flex4/</link>
		<comments>http://www.rialvalue.com/blog/2010/05/05/template-components-in-flex4/#comments</comments>
		<pubDate>Wed, 05 May 2010 17:01:32 +0000</pubDate>
		<dc:creator>Xavi Beumala</dc:creator>
				<category><![CDATA[architecture]]></category>
		<category><![CDATA[components]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[component]]></category>
		<category><![CDATA[flex4]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://www.rialvalue.com/blog/?p=171</guid>
		<description><![CDATA[Template Components can be quite common in different sort of applications. Maybe the most common one is the Panel, which has a predefined set of components (title bar, status bar, close button, etc) and an specific area where we can instantiate any other component we wish.
In Flex3 you could use the technique explained in the [...]]]></description>
			<content:encoded><![CDATA[<p>Template Components can be quite common in different sort of applications. Maybe the most common one is the Panel, which has a predefined set of components (title bar, status bar, close button, etc) and an specific area where we can instantiate any other component we wish.</p>
<p>In Flex3 you could use the technique <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=templating_1.html">explained in the Flex documentation</a> in combination with [DefaultProperty] metadata. The technique basically consists in creating a subclass of a Container component who defines properties with a general data type that lets the component user specify an object of a concrete data type and then reparents it.</p>
<p>Flex4 Skins, by definition, serve the purpose of a templating system. If you consider the example of a s:Panel you have the PanelSkin where you can really easily change and adapt the template and where and how the provided / customizable content will be placed.</p>
<p>If you have to create a templated component with just one customizable area, maybe the best approach to create it would be to use an s:SkinnableComponent. In the following example I&#8217;ve created a very simple template that places a header an a footer around a given component.</p>
<div class="codecolorer-container actionscript3 mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:515px;height:330px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000066; font-weight: bold;">&lt;?</span>xml <span style="color: #004993;">version</span>=<span style="color: #990000;">&quot;1.0&quot;</span> encoding=<span style="color: #990000;">&quot;utf-8&quot;</span><span style="color: #000066; font-weight: bold;">?&gt;</span><br />
<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>Application <br />
&nbsp; &nbsp; minWidth=<span style="color: #990000;">&quot;955&quot;</span> minHeight=<span style="color: #990000;">&quot;600&quot;</span><br />
&nbsp; &nbsp; xmlns<span style="color: #000066; font-weight: bold;">:</span>fx=<span style="color: #990000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span><br />
&nbsp; &nbsp; xmlns<span style="color: #000066; font-weight: bold;">:</span>s=<span style="color: #990000;">&quot;library://ns.adobe.com/flex/spark&quot;</span><br />
&nbsp; &nbsp; xmlns<span style="color: #000066; font-weight: bold;">:</span>mx=<span style="color: #990000;">&quot;library://ns.adobe.com/flex/mx&quot;</span><br />
&nbsp; &nbsp; xmlns<span style="color: #000066; font-weight: bold;">:</span>local=<span style="color: #990000;">&quot;*&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>layout<span style="color: #000066; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>VerticalLayout <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; horizontalAlign=<span style="color: #990000;">&quot;center&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; verticalAlign=<span style="color: #990000;">&quot;middle&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">&lt;/</span>s<span style="color: #000066; font-weight: bold;">:</span>layout<span style="color: #000066; font-weight: bold;">&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>SkinnableContainer <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;200&quot;</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;200&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; skinClass=<span style="color: #990000;">&quot;TemplateSkin1&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">&lt;</span>local<span style="color: #000066; font-weight: bold;">:</span>MyComponent <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;100%&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">backgroundColor</span>=<span style="color: #990000;">&quot;0xff0000&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">&lt;/</span>s<span style="color: #000066; font-weight: bold;">:</span>SkinnableContainer<span style="color: #000066; font-weight: bold;">&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>SkinnableContainer <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;200&quot;</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;200&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; skinClass=<span style="color: #990000;">&quot;TemplateSkin1&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">&lt;</span>local<span style="color: #000066; font-weight: bold;">:</span>MyComponent <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;100%&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">backgroundColor</span>=<span style="color: #990000;">&quot;0x00ff00&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">&lt;/</span>s<span style="color: #000066; font-weight: bold;">:</span>SkinnableContainer<span style="color: #000066; font-weight: bold;">&gt;</span><br />
<span style="color: #000066; font-weight: bold;">&lt;/</span>s<span style="color: #000066; font-weight: bold;">:</span>Application<span style="color: #000066; font-weight: bold;">&gt;</span></div></div>
<p>Where TemplateSkin1 is:</p>
<div class="codecolorer-container actionscript3 mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:515px;height:330px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000066; font-weight: bold;">&lt;?</span>xml <span style="color: #004993;">version</span>=<span style="color: #990000;">&quot;1.0&quot;</span> encoding=<span style="color: #990000;">&quot;utf-8&quot;</span><span style="color: #000066; font-weight: bold;">?&gt;</span><br />
<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>Skin xmlns<span style="color: #000066; font-weight: bold;">:</span>fx=<span style="color: #990000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span><br />
&nbsp; &nbsp; xmlns<span style="color: #000066; font-weight: bold;">:</span>s=<span style="color: #990000;">&quot;library://ns.adobe.com/flex/spark&quot;</span><br />
&nbsp; &nbsp; <span style="color: #004993;">alpha</span><span style="color: #000066; font-weight: bold;">.</span>disabled=<span style="color: #990000;">&quot;0.5&quot;</span><br />
&nbsp; &nbsp; xmlns<span style="color: #000066; font-weight: bold;">:</span>local=<span style="color: #990000;">&quot;*&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">&lt;</span>fx<span style="color: #000066; font-weight: bold;">:</span>Metadata<span style="color: #000066; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">&lt;!</span><span style="color: #000000;">&#91;</span>CDATA<span style="color: #000000;">&#91;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span>HostComponent<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;spark.components.SkinnableContainer&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">&lt;/</span>fx<span style="color: #000066; font-weight: bold;">:</span>Metadata<span style="color: #000066; font-weight: bold;">&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>states<span style="color: #000066; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>State <span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;normal&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>State <span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;disabled&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">&lt;/</span>s<span style="color: #000066; font-weight: bold;">:</span>states<span style="color: #000066; font-weight: bold;">&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>layout<span style="color: #000066; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>VerticalLayout gap=<span style="color: #990000;">&quot;0&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">&lt;/</span>s<span style="color: #000066; font-weight: bold;">:</span>layout<span style="color: #000066; font-weight: bold;">&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">&lt;</span>local<span style="color: #000066; font-weight: bold;">:</span>Bar <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">text</span>=<span style="color: #990000;">&quot;Header&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>Group id=<span style="color: #990000;">&quot;contentGroup&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;100%&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; minWidth=<span style="color: #990000;">&quot;0&quot;</span> minHeight=<span style="color: #990000;">&quot;0&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>layout<span style="color: #000066; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>BasicLayout<span style="color: #000066; font-weight: bold;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">&lt;/</span>s<span style="color: #000066; font-weight: bold;">:</span>layout<span style="color: #000066; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">&lt;/</span>s<span style="color: #000066; font-weight: bold;">:</span>Group<span style="color: #000066; font-weight: bold;">&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">&lt;</span>local<span style="color: #000066; font-weight: bold;">:</span>Bar <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">text</span>=<span style="color: #990000;">&quot;Footer&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span><br />
<span style="color: #000066; font-weight: bold;">&lt;/</span>s<span style="color: #000066; font-weight: bold;">:</span>Skin<span style="color: #000066; font-weight: bold;">&gt;</span></div></div>
<p>The SkinnableContainer base class provides a series of functionalities like creationPolicy and layout property proxying or deferred instantiation that makes very easy the task of creating templated components.</p>
<p>
<object width="525" height="500">
<param name="movie" value="http://www.rialvalue.com/components/templating/templating.swf" />
<param name="quality" value="high" />
<param name="wmode" value="window" />
<param name="menu" value="false" />
<param name="bgcolor" value="#FFFFFF" />
<param name="allowFullScreen" value="true"></param>
<embed type="application/x-shockwave-flash" width="525" height="500" src="http://www.rialvalue.com/components/templating/templating.swf" quality="high" bgcolor="#FFFFFF" wmode="window" menu="false" allowFullScreen="true" ></embed>
</object>
</p>
<p><a href="http://www.rialvalue.com/components/templating/">See sample fullScreen</a><br />
<a href="http://www.rialvalue.com/components/templating/srcview">Browse code.</a></p>
<p>In more complex scenarios where the template has more than one customizable area SkinnableContainer might not be the best choice. You can find further information about this scenario in the <a href="http://www.rialvalue.com/blog/2010/05/05/dualpanel-reversible-component/">DualPanel component post</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rialvalue.com/blog/2010/05/05/template-components-in-flex4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disabling Bindings on certain Views to avoid unnecessary processing time</title>
		<link>http://www.rialvalue.com/blog/2010/05/05/disabling-bindings-on-certain-views-to-avoid-unnecessary-processing-time/</link>
		<comments>http://www.rialvalue.com/blog/2010/05/05/disabling-bindings-on-certain-views-to-avoid-unnecessary-processing-time/#comments</comments>
		<pubDate>Wed, 05 May 2010 14:35:55 +0000</pubDate>
		<dc:creator>Xavi Beumala</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://www.rialvalue.com/blog/?p=169</guid>
		<description><![CDATA[Once a view has been created, Bindings will always be active no matter if the view is invisible or removed from Stage.
There might be cases when a View is constantly receiving Binding updates (i.e. connected to an LCDS server with big amount of data transfer or messages). Imagine the view that is processing all the [...]]]></description>
			<content:encoded><![CDATA[<p>Once a view has been created, Bindings will always be active no matter if the view is invisible or removed from Stage.<br />
There might be cases when a View is constantly receiving Binding updates (i.e. connected to an LCDS server with big amount of data transfer or messages). Imagine the view that is processing all the updates is off the screen. Although the most expensive part of the processing in terms of CPU is the UI and it&#8217;s not being processed because it&#8217;s invisible, We could still say it&#8217;s consuming resources unnecessarly.</p>
<p>If you want you can disable or enable selectively the Bindings in an mxml document using the BindingManager:</p>
<div class="codecolorer-container actionscript3 mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:515px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">BindingManager<span style="color: #000066; font-weight: bold;">.</span>setEnabled<span style="color: #000000;">&#40;</span> document<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div></div>
<p>You could enable or disable the bindings according to the visibility of the document.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rialvalue.com/blog/2010/05/05/disabling-bindings-on-certain-views-to-avoid-unnecessary-processing-time/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Carroflow. Another 3D layout for Flex4</title>
		<link>http://www.rialvalue.com/blog/2010/04/14/carroflow-another-3d-layout-for-flex4/</link>
		<comments>http://www.rialvalue.com/blog/2010/04/14/carroflow-another-3d-layout-for-flex4/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 18:59:39 +0000</pubDate>
		<dc:creator>Xavi Beumala</dc:creator>
				<category><![CDATA[flex]]></category>
		<category><![CDATA[3d]]></category>
		<category><![CDATA[layout]]></category>

		<guid isPermaLink="false">http://www.rialvalue.com/blog/?p=157</guid>
		<description><![CDATA[This is an experiment I did a while ago when working on the Coverflow layout. I&#8217;ve been waiting to find some spare time to fine tune it, to improve it&#8217;s performance, clean the code and tweaking in general. But I know that if I don&#8217;t push it out now it will be lost in some [...]]]></description>
			<content:encoded><![CDATA[<p>This is an experiment I did a while ago when working on <a href="http://www.rialvalue.com/blog/2010/03/30/flex4-coverflow-layout/">the Coverflow layout</a>. I&#8217;ve been waiting to find some spare time to fine tune it, to improve it&#8217;s performance, clean the code and tweaking in general. But I know that if I don&#8217;t push it out now it will be lost in some random folder, so it&#8217;s better I release it as is and maybe someone can pick it from where it is ツ</p>
<p>I think this layout would be nice for Mobile devices to quickly browse content by tapping and dragging. I&#8217;ve tested it in different devices and from a usability perspective it&#8217;s very nice. I can see a big potential on it.</p>
<p>
<object width="525" height="550">
<param name="movie" value="http://www.rialvalue.com/carroflow/carroflow.swf" />
<param name="quality" value="high" />
<param name="wmode" value="window" />
<param name="menu" value="false" />
<param name="bgcolor" value="#FFFFFF" />
<param name="allowFullScreen" value="true"></param>
<embed type="application/x-shockwave-flash" width="525" height="550" src="http://www.rialvalue.com/carroflow/carroflow.swf" quality="high" bgcolor="#FFFFFF" wmode="window" menu="false" allowFullScreen="true" ></embed>
</object>
 </p>
<p>You can check the code <a href="/carroflow/srcview">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rialvalue.com/blog/2010/04/14/carroflow-another-3d-layout-for-flex4/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Flex4 Coverflow Layout</title>
		<link>http://www.rialvalue.com/blog/2010/03/30/flex4-coverflow-layout/</link>
		<comments>http://www.rialvalue.com/blog/2010/03/30/flex4-coverflow-layout/#comments</comments>
		<pubDate>Tue, 30 Mar 2010 16:05:06 +0000</pubDate>
		<dc:creator>Xavi Beumala</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[components]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[nexusOne]]></category>

		<guid isPermaLink="false">http://www.rialvalue.com/blog/?p=139</guid>
		<description><![CDATA[Flex4 has shipped and it comes with a ton of new features that open lots of doors. One of my preferred features in which I see a tremendous potential is the new layout mechanism.
As an exercise to better understand the details of the new layout mechanism I played a couple of days creating some layouts [...]]]></description>
			<content:encoded><![CDATA[<p>Flex4 has shipped and it comes with a ton of new features that open lots of doors. One of my preferred features in which I see a tremendous potential is the new layout mechanism.</p>
<p>As an exercise to better understand the details of the new layout mechanism I played a couple of days creating some layouts that I&#8217;ll be posting during the next days.</p>
<p>The first layout I created was a Coverflow layout. There already exist several implementations out there for Flash and even Flex. The biggest difference in this implementation is that it&#8217;s using standard 2.5D APIs and the standard Flex4 layout mechanism. This translates in a 200 lines of code and quite good performance.</p>

<a href='http://www.rialvalue.com/blog/2010/03/30/flex4-coverflow-layout/coverflow3/' title='coverflow3'><img width="150" height="150" src="http://www.rialvalue.com/blog/files/coverflow3-150x150.png" class="attachment-thumbnail" alt="" title="coverflow3" /></a>
<a href='http://www.rialvalue.com/blog/2010/03/30/flex4-coverflow-layout/coverflow2/' title='coverflow2'><img width="150" height="150" src="http://www.rialvalue.com/blog/files/coverflow2-150x150.png" class="attachment-thumbnail" alt="" title="coverflow2" /></a>
<a href='http://www.rialvalue.com/blog/2010/03/30/flex4-coverflow-layout/coverflow1/' title='coverflow1'><img width="150" height="150" src="http://www.rialvalue.com/blog/files/coverflow1-150x150.jpg" class="attachment-thumbnail" alt="" title="coverflow1" /></a>

<p>Bear in mind that:</p>
<ol>
<li>This is not production ready code and might have issues.</li>
<li>I haven&#8217;t optimised the code at all, it&#8217;s almost a first pass code.</li>
<li>The layout is not using any virtualization capabilities, which means that won&#8217;t perform nicely with big dataproviders. I&#8217;ll implement this in the future.</li>
<li>I&#8217;ve added several configuration parameters and some combinations might not work as good as others.</li>
</ol>
<p>As an extra, and even though Flex4 is not specifically designed for mobile, see how it works in a Nexus One with FP 10.1 beta. In the video below you can see how the application runs just out of the box, no recompilation, no changes at all. Same content that runs in my laptop runs in <a href="http://www.duvos.com">Enrique&#8217;s phone</a>. The performance is really nice! What the Flash Player team has achieved is amazing!<br />
congratulations guys!! </p>
<p>
<object width="480" height="320">
<param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=10552927&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1&amp;group_id=" />
<param name="quality" value="high" />
<param name="wmode" value="window" />
<param name="menu" value="false" />
<param name="bgcolor" value="#FFFFFF" />
<param name="allowFullScreen" value="true"></param>
<embed type="application/x-shockwave-flash" width="480" height="320" src="http://vimeo.com/moogaloop.swf?clip_id=10552927&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1&amp;group_id=" quality="high" bgcolor="#FFFFFF" wmode="window" menu="false" allowFullScreen="true" ></embed>
</object>
</p>
<p>You can run the application <a href="http://www.rialvalue.com/coverflow">here http://www.rialvalue.com/coverflow</a><br />
You can get the source code <a href="http://rialvalue.com/coverflow/srcview">here http://rialvalue.com/coverflow/srcview</a></p>
<p>Which parameter combination do you like more?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rialvalue.com/blog/2010/03/30/flex4-coverflow-layout/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
	</channel>
</rss>
