<?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>Insane Theory - The blog of James Netherton &#187; Flex</title>
	<atom:link href="http://www.jamesnetherton.com/blog/category/Flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jamesnetherton.com/blog</link>
	<description>My view on web technology, programming and life</description>
	<lastBuildDate>Thu, 29 Apr 2010 20:24:15 +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>Flex coding standards and best practices</title>
		<link>http://www.jamesnetherton.com/blog/2008/07/07/Flex-coding-standards-and-best-practices/</link>
		<comments>http://www.jamesnetherton.com/blog/2008/07/07/Flex-coding-standards-and-best-practices/#comments</comments>
		<pubDate>Mon, 07 Jul 2008 08:07:00 +0000</pubDate>
		<dc:creator>James Netherton</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Adobe have added a list of Flex standards and best practices on their open source wiki.
Apparently it&#8217;s not 100% complete yet but it&#8217;s a nice set of guidelines nonetheless.
http://opensource.adobe.com/wiki/display/flexsdk/Coding+Conventions

]]></description>
			<content:encoded><![CDATA[<p>Adobe have added a list of Flex standards and best practices on their open source wiki.</p>
<p>Apparently it&#8217;s not 100% complete yet but it&#8217;s a nice set of guidelines nonetheless.</p>
<p><a href="http://opensource.adobe.com/wiki/display/flexsdk/Coding+Conventions">http://opensource.adobe.com/wiki/display/flexsdk/Coding+Conventions<br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jamesnetherton.com/blog/2008/07/07/Flex-coding-standards-and-best-practices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Issues with Flex DataGrid and custom ItemRenderers</title>
		<link>http://www.jamesnetherton.com/blog/2008/02/15/Issues-with-Flex-DataGrid-and-custom-ItemRenderers/</link>
		<comments>http://www.jamesnetherton.com/blog/2008/02/15/Issues-with-Flex-DataGrid-and-custom-ItemRenderers/#comments</comments>
		<pubDate>Fri, 15 Feb 2008 13:02:00 +0000</pubDate>
		<dc:creator>James Netherton</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I&#8217;ve just finished implementing a work around for some problematic behaviour I came across within the Flex DataGrid. I have a user interface which has a DataGrid with custom item renderers so that combo boxes can be rendered within DataGrid cells. In order to set the combo box selected index to it&#8217;s appropriate value, I [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just finished implementing a work around for some problematic behaviour I came across within the Flex DataGrid. I have a user interface which has a DataGrid with custom item renderers so that combo boxes can be rendered within DataGrid cells. In order to set the combo box selected index to it&#8217;s appropriate value, I was invoking some custom code on the combo creationComplete event. </p>
<p>Some freaky things were happening when data within the grid was being refreshed. Some of the combo selected values were not in the order I expected them to be in.</p>
<p>After doing some digging, it seems that DataGrid ItemRenderers are reused for performance reasons. This is a problem if using the creationComplete event. </p>
<p>The solution is to override the container &#8216;data&#8217; setter property method, with an implementation like the following:</p>
<pre class="syntax-highlight:cf">
public override function set data(value:Object):void{

    super.data = value;

    if(value == null){
        return;
    }

    //Further custom logic here....

}
</pre>
<p>There&#8217;s a great overview of the problem over at <a href="http://teratechnologies.net/stevekamerman/index.php?m=01&amp;y=08&amp;entry=entry080110-093749" title="Steve Kamerman's Blog">Steve Kamerman&#8217;s Blog</a>. There&#8217;s also a nice working example <a href="http://devel.teratechnologies.net/steve_examples/Flex_DataGridProblem/DataGridTest.html">here</a>.</p>
<p>Some other blog posts that helped are:</p>
<p><a href="http://www.trajiklyhip.com/blog/index.cfm/2006/11/3/Flex-DataGrid-ItemRenderers-Explained">Flex DataGrid ItemRenderers Explained</a></p>
<p><a href="http://www.returnundefined.com/2006/10/item-renderers-in-datagrids-a-primer-for-predictable-behavior/">Item Renderers in DataGrids &#8211; A Primer for Predictable Behavior</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jamesnetherton.com/blog/2008/02/15/Issues-with-Flex-DataGrid-and-custom-ItemRenderers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing Flex Builder 2 with Eclipse 3.3</title>
		<link>http://www.jamesnetherton.com/blog/2008/01/27/Installing-Flex-Builder-2-with-Eclipse-33/</link>
		<comments>http://www.jamesnetherton.com/blog/2008/01/27/Installing-Flex-Builder-2-with-Eclipse-33/#comments</comments>
		<pubDate>Sun, 27 Jan 2008 09:01:00 +0000</pubDate>
		<dc:creator>James Netherton</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I&#8217;ve just suffered the pain in trying to get Flex Builder 2 integrated with Eclipse 3.3.
The answers to getting it configured sucessfully are within this article at Eclipse Zone
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just suffered the pain in trying to get Flex Builder 2 integrated with Eclipse 3.3.</p>
<p>The answers to getting it configured sucessfully are within this article at <a href="http://www.eclipsezone.com/articles/howto-flexbuilder2/" title="Eclipse Zone" target="_blank">Eclipse Zone</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jamesnetherton.com/blog/2008/01/27/Installing-Flex-Builder-2-with-Eclipse-33/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ActionScript ColdFusion variable translation</title>
		<link>http://www.jamesnetherton.com/blog/2007/08/30/ActionScript-ColdFusion-variable-translation/</link>
		<comments>http://www.jamesnetherton.com/blog/2007/08/30/ActionScript-ColdFusion-variable-translation/#comments</comments>
		<pubDate>Thu, 30 Aug 2007 00:08:00 +0000</pubDate>
		<dc:creator>James Netherton</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Thought I would post this as I can never track down this information via livedocs.
Here&#8217;s what data type ColdFusion variables get converted to in ActionScript when making remote calls to CF services:

ColdFusion data type      ActionScript data type
String              [...]]]></description>
			<content:encoded><![CDATA[<p>Thought I would post this as I can never track down this information via livedocs.</p>
<p>Here&#8217;s what data type ColdFusion variables get converted to in ActionScript when making remote calls to CF services:</p>
<pre>
ColdFusion data type      ActionScript data type<br/>
String                    String <br/>
Array                     Array <br/>
Struct                    Untyped Object <br/>
Query                     Array of untyped Objects <br/>
CFC Class                 typed Object <br/>
CFC Date                  ActionScript Date <br/>
CFC String                ActionScript String <br/>
CFC Numeric               ActionScript Numeric <br/>
ColdFusion XML Object     ActionScript XML Object
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.jamesnetherton.com/blog/2007/08/30/ActionScript-ColdFusion-variable-translation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Change to services-config.xml in ColdFusion 8</title>
		<link>http://www.jamesnetherton.com/blog/2007/08/10/Change-to-services-config-xml-in-ColdFusion-8/</link>
		<comments>http://www.jamesnetherton.com/blog/2007/08/10/Change-to-services-config-xml-in-ColdFusion-8/#comments</comments>
		<pubDate>Fri, 10 Aug 2007 09:08:00 +0000</pubDate>
		<dc:creator>James Netherton</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I&#8217;m not sure whether this changed in the ColdFusion 8 release candidate or in the final release&#8230;..
A subtle change has been made to services-config.xml from the format that has been used since ColdFusion 7.0.2 and through the ColdFusion 8 beta releases.
The Flash Remoting definition for ColdFusion has been moved out of services-config.xml to a separate [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not sure whether this changed in the ColdFusion 8 release candidate or in the final release&#8230;..</p>
<p>A subtle change has been made to services-config.xml from the format that has been used since ColdFusion 7.0.2 and through the ColdFusion 8 beta releases.</p>
<p>The Flash Remoting definition for ColdFusion has been moved out of services-config.xml to a separate XML file named remoting-config.xml.</p>
<p>Something to be aware of if you&#8217;re writing applications that aren&#8217;t using their own individual config files.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jamesnetherton.com/blog/2007/08/10/Change-to-services-config-xml-in-ColdFusion-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex Builder memory usage</title>
		<link>http://www.jamesnetherton.com/blog/2007/05/15/Flex-Builder-memory-usage/</link>
		<comments>http://www.jamesnetherton.com/blog/2007/05/15/Flex-Builder-memory-usage/#comments</comments>
		<pubDate>Tue, 15 May 2007 04:05:00 +0000</pubDate>
		<dc:creator>James Netherton</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[
A quick Flex Builder rant&#8230;..
Above is the typical amount of memory usage and swap space that Flex Builder uses on my work machine.
I&#8217;ve seen it way higher than that on some occasions. What the hell is the thing doing to eat up that much RAM? Flex Builder consumes around 200Mb &#8211; 250Mb RAM until you [...]]]></description>
			<content:encoded><![CDATA[<p><img src="/blog/images/posts/flex-builder-memory.jpg" alt="Flex Builder Memory Usage" height="" width=""/></p>
<p>A quick Flex Builder rant&#8230;..</p>
<p>Above is the typical amount of memory usage and swap space that Flex Builder uses on my work machine.</p>
<p>I&#8217;ve seen it way higher than that on some occasions. What the hell is the thing doing to eat up that much RAM? Flex Builder consumes around 200Mb &#8211; 250Mb RAM until you enter design mode, which seems to gobble up another 50Mb &#8211; 100Mb.</p>
<p>It&#8217;s annoying &#8211; maybe there are some JVM tweaks that will help.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jamesnetherton.com/blog/2007/05/15/Flex-Builder-memory-usage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cairngorm Eclipse Plugin</title>
		<link>http://www.jamesnetherton.com/blog/2007/03/08/Cairngorm-Eclipse-Plugin/</link>
		<comments>http://www.jamesnetherton.com/blog/2007/03/08/Cairngorm-Eclipse-Plugin/#comments</comments>
		<pubDate>Thu, 08 Mar 2007 15:03:00 +0000</pubDate>
		<dc:creator>James Netherton</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[This looks awesome!
Introducing Cairngorm Plugin
If only this were around a few months ago! It would have made development of a Flex application I&#8217;m working on, a breeze! Check out some of the screen shots over at the site.
]]></description>
			<content:encoded><![CDATA[<p>This looks awesome!</p>
<p><a href="http://blog.thinkingdigital.org/?p=3">Introducing Cairngorm Plugin</a></p>
<p>If only this were around a few months ago! It would have made development of a Flex application I&#8217;m working on, a breeze! Check out some of the screen shots over at the site.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jamesnetherton.com/blog/2007/03/08/Cairngorm-Eclipse-Plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex stack overflow gotcha</title>
		<link>http://www.jamesnetherton.com/blog/2007/02/27/Flex-stack-overflow-gotcha/</link>
		<comments>http://www.jamesnetherton.com/blog/2007/02/27/Flex-stack-overflow-gotcha/#comments</comments>
		<pubDate>Tue, 27 Feb 2007 22:02:00 +0000</pubDate>
		<dc:creator>James Netherton</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I finally got to the bottom of what was making FlashPlayer crash with a piece of code I had in one of my apps. Turns out I was getting stack overflow exceptions as a result of an event firing repeatedly.
Here&#8217;s an example application which explains what I was doing:
&#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62;
&#60;mx:Application xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; layout=&#34;absolute&#34; creationComplete=&#34;setData()&#34;&#62;

	&#60;mx:Script&#62;
		&#60;![CDATA[
			import mx.events.DataGridEvent;
			import [...]]]></description>
			<content:encoded><![CDATA[<p>I finally got to the bottom of what was making FlashPlayer crash with a piece of code I had in one of my apps. Turns out I was getting stack overflow exceptions as a result of an event firing repeatedly.</p>
<p>Here&#8217;s an example application which explains what I was doing:</p>
<pre class="syntax-highlight:cf">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; layout=&quot;absolute&quot; creationComplete=&quot;setData()&quot;&gt;

	&lt;mx:Script&gt;
		&lt;![CDATA[
			import mx.events.DataGridEvent;
			import mx.collections.ArrayCollection;

			[Bindable]
			private var gridData:ArrayCollection = new ArrayCollection();

			private function setData():void
			{
				for(var i:Number = 1; i &lt; 10; i++)
				{
					var obj:Object = new Object();
					obj.id = i;
					obj.name = &quot;Name &quot; + i;

					gridData.addItem(obj);
				}
			}

			private function validateEdit(event:DataGridEvent):void
			{
                var newVal:String = event.currentTarget.itemEditorInstance.text;				

				if(newVal.length &gt; 150 &amp;&amp; event.reason == &quot;newRow&quot;)
				{
					mx.controls.Alert.show(&quot;Value cannot exceed 150 characters in length&quot;);
					return;
				}
			}

		]]&gt;
	&lt;/mx:Script&gt;

	&lt;mx:DataGrid width=&quot;100%&quot;
				 height=&quot;100%&quot;
				 dataProvider=&quot;{gridData}&quot;
				 itemEditEnd=&quot;validateEdit(event)&quot;
				 editable=&quot;true&quot;&gt;
		&lt;mx:columns&gt;
			&lt;mx:DataGridColumn dataField=&quot;id&quot; headerText=&quot;Person Id&quot;/&gt;
			&lt;mx:DataGridColumn dataField=&quot;name&quot; headerText=&quot;Person Name&quot; editable=&quot;true&quot;/&gt;
		&lt;/mx:columns&gt;
	&lt;/mx:DataGrid&gt;	

&lt;/mx:Application&gt;</pre>
<p>It&#8217;s quite straightforward. I populate a DataGrid component with some dummy data. The person name column is made editable. Whenever a value is entered into the DataGrid cell the validateEdit method traps the itemEditEnd event and checks to see whether the string entered was greater than 150 characters.</p>
<p>If the condition evaluates to true, an Alert box is displayed.</p>
<p>Run the application, click one of the editable DataGrid cells and enter a string longer than 150 characters, the result should be that your browser or Flash Player will crash.</p>
<p>Now add a trace statement into the validateEdit method:</p>
<pre class="syntax-highlight:cf">trace(event.reason)</pre>
<p>Run the application again and enter another string longer than 150 characters into the editable DataGrid cell.</p>
<p>The application will crash again, but the trace output should reveal that the itemEditEnd event was fired over a hundred times which means that the Alert popup will be attempted to be displayed each time &#8211; obviously not very performant and hence the stack overflow!</p>
<p>The trace also reveals that all of the event reasons were for type &#8216;other&#8217;, but the actual item edit event was for type &#8216;newRow&#8217;.</p>
<p>So the solution is quite simple, we simply add an extra condition into the if statement that checks the character length.</p>
<pre class="syntax-highlight:cf">if(newVal.length &gt; 150 &amp;&amp; event.reason == &quot;newRow&quot;)</pre>
<p>Rerun the application and hopefully no more stack overflow errors will occur <img src='http://www.jamesnetherton.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jamesnetherton.com/blog/2007/02/27/Flex-stack-overflow-gotcha/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>AMFPHP 1.9 beta 2 released</title>
		<link>http://www.jamesnetherton.com/blog/2007/01/29/AMFPHP-19-beta-2-released/</link>
		<comments>http://www.jamesnetherton.com/blog/2007/01/29/AMFPHP-19-beta-2-released/#comments</comments>
		<pubDate>Mon, 29 Jan 2007 15:01:00 +0000</pubDate>
		<dc:creator>James Netherton</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[The beta 2 of AMFPHP 1.9 has been released to the claim of:

amfphp the fastest Remoting implementation ever


The performance figures are truely impressive. Time I started having a mess around with getting PHP talking with Flex 2 methinks&#8230;
]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.sephiroth.it/weblog/archives/2007/01/amfphp_19_beta_2_so_fassssssst.php">beta 2 of AMFPHP 1.9</a> has been released to the claim of:</p>
<blockquote><div id="quote">
<div id="quotebody">amfphp the fastest Remoting implementation ever</div>
</div>
</blockquote>
<p>The performance figures are truely impressive. Time I started having a mess around with getting PHP talking with Flex 2 methinks&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jamesnetherton.com/blog/2007/01/29/AMFPHP-19-beta-2-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Permanent ComboBox Prompt in Flex 2</title>
		<link>http://www.jamesnetherton.com/blog/2007/01/14/Permanent-ComboBox-Prompt-in-Flex-2/</link>
		<comments>http://www.jamesnetherton.com/blog/2007/01/14/Permanent-ComboBox-Prompt-in-Flex-2/#comments</comments>
		<pubDate>Sun, 14 Jan 2007 17:01:00 +0000</pubDate>
		<dc:creator>James Netherton</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[One of the things that bugs me about the flex combo box component is that if you set a default option, or prompt, it disappears once the user selects a value from the drop list.
The permanent flex combo box prompt was recently posted Adobe Flex Cookboox site to solve the problem.
]]></description>
			<content:encoded><![CDATA[<p>One of the things that bugs me about the flex combo box component is that if you set a default option, or prompt, it disappears once the user selects a value from the drop list.</p>
<p>The <a href="http://www.jessewarden.com/archives/2007/01/permanent_combo.html">permanent flex combo box prompt</a> was recently posted Adobe Flex Cookboox site to solve the problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jamesnetherton.com/blog/2007/01/14/Permanent-ComboBox-Prompt-in-Flex-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
