<?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>Kerkness.ca &#187; flex</title>
	<atom:link href="http://www.kerkness.ca/tagged/flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kerkness.ca</link>
	<description>flexing my kerkness, among other things</description>
	<lastBuildDate>Wed, 14 Oct 2009 15:12:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.3</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Monitor your flash log when debugging Flex or Air Application on OSX</title>
		<link>http://www.kerkness.ca/monitor-your-flash-log-when-debugging-flex-or-air-application-on-osx/</link>
		<comments>http://www.kerkness.ca/monitor-your-flash-log-when-debugging-flex-or-air-application-on-osx/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 20:37:41 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[adobe air]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/?p=404</guid>
		<description><![CDATA[When building and debugging a Flex or Air application it can be a big help if you&#8217;re able to monitor the progress the application makes through your various classes and views.  A great way to do this is to add trace(&#8221;I am here&#8221;) function calls to your code and then monitor the flash log [...]]]></description>
			<content:encoded><![CDATA[<p>When building and debugging a Flex or Air application it can be a big help if you&#8217;re able to monitor the progress the application makes through your various classes and views.  A great way to do this is to add <strong><em>trace(&#8221;I am here&#8221;)</em></strong> function calls to your code and then monitor the flash log file when running the application.</p>
<ol>
<li>Make sure you have the debugger version of the flash player installed</li>
<li>Add  trace(&#8221;your test message or details&#8221;);  to your code where appropriate</li>
<li>Open Applications/Utilities/Terminal</li>
<li>Go to the location of the Flash log file..<br />
<strong><em>/Users/[username]/Library/Preferences/[App Name]/Local Store/<br />
</em></strong></li>
<li>Type the following command<br />
<strong><em>tail -f flashlog.txt<br />
</em></strong></li>
<li>Launch your application.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/monitor-your-flash-log-when-debugging-flex-or-air-application-on-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating an ItemRenderer in ActionScript</title>
		<link>http://www.kerkness.ca/creating-an-itemrenderer-in-actionscript/</link>
		<comments>http://www.kerkness.ca/creating-an-itemrenderer-in-actionscript/#comments</comments>
		<pubDate>Thu, 06 Nov 2008 21:17:00 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/blog/?p=64</guid>
		<description><![CDATA[I&#8217;m posting this for my benefit as much as anyone else. Here is a very basic ItemRenderer done in ActionScript.  Something you might come across when building Flex/Air applications is errand problems with ItemRenderer&#8217;s not performing as expected, sucking up lots of memory, or throwing errors.  Many times these problems can be solved [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m posting this for my benefit as much as anyone else. Here is a very basic ItemRenderer done in ActionScript.  Something you might come across when building Flex/Air applications is errand problems with ItemRenderer&#8217;s not performing as expected, sucking up lots of memory, or throwing errors.  Many times these problems can be solved by building your renderer in ActionScript.  Here is the source for a basic item renderer which can be scaled up as needed.</p>
<pre name="code" class="javascript">package my.renderer
{
 import my.model.DataModel;

 import mx.controls.Label;
 import mx.controls.listClasses.IListItemRenderer;
 import mx.controls.listClasses.ListBase;
 import mx.core.UIComponent;

 public class ArtListRenderer extends UIComponent implements IListItemRenderer
 {
  public function ArtListRenderer()
  {
   super();
  }

     [Bindable] public var myData:DataModel = new DataModel();

     // Internal variable for the property value.
     private var _data:Object;

     // Make the data property bindable.
     [Bindable("dataChange")]

     // Define the getter method.
     public function get data():Object {
         return _data;
     }

     // Define the setter method, and dispatch an event when the property
     // changes to support data binding.
     public function set data(value:Object):void {
         _data = value;

         myData = new DataModel();
         myData.firstname = value.firstname;
         myData.lastname = value.lastname;

         invalidateProperties();
         dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
     }

     private var hBox:HBox;
     private var firstnameLabel:Label;
     private var lastnameLabel:Label;

     override protected function createChildren():void
     {
      super.createChildren();

      hBox = new HBox();

      firstnameLabel = new Label();
      lastnameLabel = new Label();
      hBox.addChild( firstnameLabel );
      hBox.addChild( lastnameLabel );

     }  

     override protected function commitProperties():void
     {
      super.commitProperties();

      hBox.horizontalScrollPolicy = 'off';
      hBox.verticalScrollPolicy = 'off';

      hBox.percentWidth = 100;

      firstnameLabel.text = myData.firstname;
      lastnameLabel.text = myData.lastname;
     }

     override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
     {
      super.updateDisplayList(unscaledWidth,unscaledHeight);
      hBox.move(0,0);
      hBox.setActualSize( (unscaledWidth-4), unscaledHeight);
     }
 }
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/creating-an-itemrenderer-in-actionscript/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Get PHP dynamic variables inside Flex</title>
		<link>http://www.kerkness.ca/get-php-dynamic-variables-inside-flex/</link>
		<comments>http://www.kerkness.ca/get-php-dynamic-variables-inside-flex/#comments</comments>
		<pubDate>Fri, 17 Oct 2008 00:52:00 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/blog/?p=61</guid>
		<description><![CDATA[Let&#8217;s say that before you load your flex application you want to pass some dynamic variables from PHP for it to act upon. This can be done pretty easily by slipping the values into PHP&#8217;s&#160; $_GET array and using Flex&#8217;s ExternalInterface class to get access to them from inside the Flex app.
Here is an example [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s say that before you load your flex application you want to pass some dynamic variables from PHP for it to act upon. This can be done pretty easily by slipping the values into PHP&#8217;s&nbsp; <i>$_GET</i> array and using Flex&#8217;s <i>ExternalInterface</i> class to get access to them from inside the Flex app.</p>
<p>Here is an example Flex application which pulls values from the URL Query String.</p>
<pre>&lt;mx:Application creationcomplete="init()" layout="absolute" xmlns:mx="http://www.adobe.com/2006/mxml"&gt;
&lt;mx:Script&gt;
&lt;![CDATA[
private function init():void
{
  var qstr:String = ExternalInterface.call("window.location.search.substring", 1) as String;
  var qarr:Array = qstr.split('&amp;');

  var pairs:Array;
  for( var i:Number = 0 ; i &lt; qarr.length; i++ ){
     pairs = String( qarr[i] ).split('=');
     if( pairs[0] == 'myName' ){
           myName = pairs[1] as String;
     }
  }
}
]]&gt;
&lt;/mx:Script&gt;
&lt;mx:Label text="{myName}" /&gt;
&lt;/mx:Application&gt;</pre>
<p>
After you build the application and and Flex Builder has generated the <i>.html</i> file that displays your Flex app&nbsp; you can rename the file <i>.php</i> and then add the following to the top of the file.</p>
<pre>&#038;lt?php $_GET['myName'] = 'Hi I am Kerk'; ?&gt;</pre>
<p>
Now if you upload your SWF file and PHP file to a server that is running PHP and you open it in your browser you&#8217;ll&nbsp; see your value from PHP displayed in your Flex app.</p>
<p>I don&#8217;t know if that is a clear explanation or not,&nbsp; or if this is the best way to pass dynamic variables at load time into your flex application but it works for me.&nbsp; Comments or alternative solutions welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/get-php-dynamic-variables-inside-flex/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Force creation of complete ViewStack with creationPolicy when building a form across multiple views : Flex Tip</title>
		<link>http://www.kerkness.ca/force-creation-of-complete-viewstack-with-creationpolicy-when-building-a-form-across-multiple-views-flex-tip/</link>
		<comments>http://www.kerkness.ca/force-creation-of-complete-viewstack-with-creationpolicy-when-building-a-form-across-multiple-views-flex-tip/#comments</comments>
		<pubDate>Fri, 03 Oct 2008 21:23:00 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/blog/?p=60</guid>
		<description><![CDATA[Here&#8217;s a tip which might be useful for some people.&#160; Sometimes when building a Flex/Adobe Air interface you may want to have form elements which are built across multiple views of a ViewStack, or TabNavigator.&#160; For example I have a contact form which has some rarely used fields contained in a secondary Tab in my [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a tip which might be useful for some people.&nbsp; Sometimes when building a Flex/Adobe Air interface you may want to have form elements which are built across multiple views of a <i>ViewStack</i>, or <i>TabNavigator</i>.&nbsp; For example I have a contact form which has some rarely used fields contained in a secondary Tab in my form.</p>
<p>Problem with this approach is that the default value of a Container&#8217;s <i><b>creationPolicy</b></i> is &#8216;<i>auto</i>&#8216;.&nbsp; This means child components are only created when they are needed.&nbsp; If your user never looks at the extra tabs/view stack layers then these form elements are not available if you need to get values or set values for them.</p>
<p>The Solution is to simple set the <b><i>creationPolicy</i></b> for your <i>ViewStack</i> or <i>TabNavigator</i> to &#8216;<i>all</i>&#8216;.&nbsp; This will ensure that all child elements are created up front and are available when needed regardless if the user looks at them or not.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/force-creation-of-complete-viewstack-with-creationpolicy-when-building-a-form-across-multiple-views-flex-tip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex Tip : Use ObjectUtil for Alpha and Numeric sorting on a DataGrid</title>
		<link>http://www.kerkness.ca/flex-tip-use-objectutil-for-alpha-and-numeric-sorting-on-a-datagrid/</link>
		<comments>http://www.kerkness.ca/flex-tip-use-objectutil-for-alpha-and-numeric-sorting-on-a-datagrid/#comments</comments>
		<pubDate>Thu, 02 Oct 2008 20:13:00 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/blog/?p=59</guid>
		<description><![CDATA[If you haven&#8217;t taken the time to look at the features of Flex&#8217;s ObjectUtil you should. Inside are a few handy methods which I see getting over looked.
Two of those methods are ObjectUtil.stringCompare and ObjectUtil.numericCompare. These methods make it simple to provide intelegent sorting on DataGrid columns.
Let&#8217;s say you have a DataGrid that has one [...]]]></description>
			<content:encoded><![CDATA[<p>If you haven&#8217;t taken the time to look at the features of Flex&#8217;s <i>ObjectUtil</i> you should. Inside are a few handy methods which I see getting over looked.</p>
<p>Two of those methods are <i>ObjectUtil</i>.<i>stringCompare</i> and <i>ObjectUtil</i>.<i>numericCompare</i>. These methods make it simple to provide intelegent sorting on <i>DataGrid</i> columns.</p>
<p>Let&#8217;s say you have a <i>DataGrid</i> that has one column full of ID# and another column full of people&#8217;s names including both first and last names. Chances are the default sorting abilities of the <i>DataGrid</i> will not properly sort either column. The ID# would be sorted 1,10,11,12&#8230; instead of 1,2,3,4,5&#8230; and the column of names would sort by the first name and not the last name.</p>
<p>Lucky the <i>DataGridColumn</i> allows you to set a custom sort function via the property <i>sortCompareFunction</i>. For example look at these two <i>DataGridColumns</i>.</p>
<pre>&lt;mx:DataGridColumn headerText="ID#" dataField="contactid" sortCompareFunction="sortContactId"/&gt;
&lt;mx:DataGridColumn headerText="Name" dataField="full_name" sortCompareFunction="sortLastName"&gt;
 &lt;mx:itemRenderer&gt;
  &lt;mx:Component&gt;
    &lt;mx:Label paddingLeft="5" text="{data.firstname} {data.lastname}" /&gt;
  &lt;/mx:Component&gt;
 &lt;/mx:itemRenderer&gt;
&lt;/mx:DataGridGolumn&gt;
</pre>
<p>
The first column is for the ID# of a contact, the second column uses an <i>itemRenderer</i> and displays both the <i>firstname</i> and <i>lastname</i> for the contact. Each column defines it&#8217;s own <i>sortCompareFunction</i>. Both functions make use of methods from <i>mx.utils.ObjectUtil</i>.</p>
<pre>private function sortLastName(obj1:Object,obj2:Object):int
{
   var value1:String = (obj1.lastname == '' || obj1.lastname == null) ? null : new String(obj1.lastname);
   var value2:String = (obj2.lastname == '' || obj2.lastname == null) ? null : new String(obj2.lastname);
   return ObjectUtil.stringCompare( value1, value2, true );
}
private function sortContactId(obj1:Object,obj2:Object):int
{
   var value1:Number = (obj1.contactid == '' || obj1.contactid == null) ? null : new Number(obj1.contactid);
   var value2:Number = (obj2.contactid == '' || obj2.contactid == null) ? null : new Number(obj2.contactid);
   return ObjectUtil.numericCompare( value1, value2 );
}
</pre>
<p>
These functions are pretty straight forward.&nbsp; <i>sortLastName</i> function uses <i>stringCompare</i> method to compare the <i>lastname</i> from two objects. The flag &#8216;true&#8217; is set to make sure that the comparison is case insensitive. The <i>sortContactId</i> function uses the <i>numericCompare</i> method to compare the <i>contactid</i> from two objects.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/flex-tip-use-objectutil-for-alpha-and-numeric-sorting-on-a-datagrid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex Component : ButtonPanel puts a button in your panel header</title>
		<link>http://www.kerkness.ca/flex-component-buttonpanel-puts-a-button-in-your-panel-header/</link>
		<comments>http://www.kerkness.ca/flex-component-buttonpanel-puts-a-button-in-your-panel-header/#comments</comments>
		<pubDate>Thu, 02 Oct 2008 07:21:00 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Components]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/blog/?p=58</guid>
		<description><![CDATA[It&#8217;s always a joy when you need something and after writing a few lines of code, you have it. Such is the beauty of nice extendable components and the Flex architecture.
Today I needed a panel which had a button in the top right corner of the header. Where the &#8217;status&#8217; text is normally is.  [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s always a joy when you need something and after writing a few lines of code, you have it. Such is the beauty of nice extendable components and the Flex architecture.</p>
<p>Today I needed a panel which had a button in the top right corner of the header. Where the &#8217;status&#8217; text is normally is.  I wanted to put a &#8217;save&#8217; button there.  One problem, the mx.containers.Panel component does not have a button in the header.</p>
<p>Solution.  Make a new component which extends all the functions of the Panel and stick a button in the top corner where I want.</p>
<p><a href="http://kerkness.ca/flexexamples/ButtonPanel/ButtonPanelDemo.html">Click here to see a demo</a><a href="http://draft.blogger.com/goog_1222914079825"><br /></a><br /><a href="http://kerkness.ca/flexexamples/ButtonPanel/srcview/index.html">Click here to view the source</a></p>
<p>My new ButtonPanel component extends Panel and adds 2 new properties and 1 event.</p>
<p><b>Properties</b></p>
<p>buttonLabel : <i>String</i> &#8211; Defines the label for the button in the top corner<br />buttonPadding : <i>Number</i> &#8211; Defines how much padding to provide in the header</p>
<p><b>Event</b></p>
<p>buttonClick : <i>Event</i> &#8211; Dispatched when the button is clicked</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/flex-component-buttonpanel-puts-a-button-in-your-panel-header/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Flex Tip: ArrayCollection replace an item with setItemAt</title>
		<link>http://www.kerkness.ca/flex-tip-arraycollection-replace-an-item-with-setitemat/</link>
		<comments>http://www.kerkness.ca/flex-tip-arraycollection-replace-an-item-with-setitemat/#comments</comments>
		<pubDate>Thu, 02 Oct 2008 02:55:00 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/blog/?p=57</guid>
		<description><![CDATA[One thing which might not be clear when working with ArrayCollections in Flex is how to replace an item in the collection.&#160; The methods getItemAt and addItemAt are pretty clear in their purpose, but one method which I found myself over looking is the setItemAt method which could be more aptly named replaceItemAt as that [...]]]></description>
			<content:encoded><![CDATA[<p>One thing which might not be clear when working with <i>ArrayCollections</i> in Flex is how to replace an item in the collection.&nbsp; The methods <i>getItemAt</i> and <i>addItemAt</i> are pretty clear in their purpose, but one method which I found myself over looking is the <i>setItemAt</i> method which could be more aptly named <i>replaceItemAt</i> as that is exactly what it does.&nbsp; It replaces an item in the collection.</p>
<p>So next time you&#8217;re looking to replace an item in an <i>ArrayCollection</i> and wishing there was a <i>replaceItemAt</i> method, look no further than <a href="http://livedocs.adobe.com/flex/201/langref/mx/collections/ListCollectionView.html#setItemAt%28%29">setItemAt</a>.&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/flex-tip-arraycollection-replace-an-item-with-setitemat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP json_encode() and Flex JSON.decode Gotcha</title>
		<link>http://www.kerkness.ca/php-json_encode-and-flex-jsondecode-gotcha/</link>
		<comments>http://www.kerkness.ca/php-json_encode-and-flex-jsondecode-gotcha/#comments</comments>
		<pubDate>Sat, 13 Sep 2008 23:19:00 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[json]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/blog/?p=56</guid>
		<description><![CDATA[I came across a little &#8216;gotcha&#8217; when trying to get Flex JSON.decode to properly decode a JSON string I was producing with PHP. 
The one of the elements in the string contained &#8216; &#38;quote; &#8216; which when being encoded by php and sent as a HTTPService response back to my Flex application was being converted [...]]]></description>
			<content:encoded><![CDATA[<p>I came across a little &#8216;gotcha&#8217; when trying to get Flex <i><b>JSON.decode</b></i> to properly decode a JSON string I was producing with PHP. </p>
<p>The one of the elements in the string contained &#8216; <i><b>&amp;quote;</b></i> &#8216; which when being encoded by php and sent as a <i><b>HTTPService</b></i> response back to my Flex application was being converted back into double quotes ( <i><b>&#8220;</b></i> ). When Flex <i><b>JSON.decode </b></i>attempted to decode the string it would silently fail.  No errors or anything.</p>
<p>In my case my JSON string was already pretty complicated with lots of variable content so it took a while to figure this out.  Hopefully someone else finds this post and saves themselves some time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/php-json_encode-and-flex-jsondecode-gotcha/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex : DataGrid ItemRenderer and DoubleClick Oh My !!</title>
		<link>http://www.kerkness.ca/flex-datagrid-itemrenderer-and-doubleclick-oh-my/</link>
		<comments>http://www.kerkness.ca/flex-datagrid-itemrenderer-and-doubleclick-oh-my/#comments</comments>
		<pubDate>Sat, 30 Aug 2008 02:32:00 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/blog/?p=53</guid>
		<description><![CDATA[I love it when you come across those little &#8216;gotchas&#8217; when programming.  Today I found one and it took a while to figure out a solution/hack so I thought I would post my findings and save someone else a little time.
Scenario: You have a DataGrid which uses an ItemRenderer to display the contents of [...]]]></description>
			<content:encoded><![CDATA[<p>I love it when you come across those little &#8216;gotchas&#8217; when programming.  Today I found one and it took a while to figure out a solution/hack so I thought I would post my findings and save someone else a little time.</p>
<p><em><strong>Scenario</strong></em>: You have a DataGrid which uses an ItemRenderer to display the contents of a cell and you need this DataGrid to respond to DoubleClick events.</p>
<p><em><strong>Problem</strong></em>: The DoubleClick does not fire when the clicking occures in the white space of the item renderer.</p>
<p><em><strong>Solution</strong></em>: Enable DoubleClick in the itemRenderer as well and send the event to a dummy event handler.</p>
<p>Here&#8217;s an example to clarify.  First a MXML component containing the DataGrid.</p>
<pre>&lt;mx:Script&gt;
&lt;![CDATA[
import mx.controls.Alert;
private function dblClickHandler(event:ListEvent):void
{
  Alert.show("Double your fun");
}
]]&gt;&lt;/mx:Script&gt;
&lt;mx:DataGrid id="myGrid" width="100%" dataProvider="{myArrayCollection}"
doubleClickEnabled="true" itemDoubleClick="dblClickHandler(event)"&gt;
 &lt;mx:columns&gt;
  &lt;mx:DataGridColumn headerText="Col1" itemRenderer="claire.renderer.myCol" /&gt;
  &lt;/mx:columns&gt;
&lt;/mx:DataGrid&gt;</pre>
<p>Here is the itemRenderer <em> claire.renderer.myCol</em>. Basically we enable double click and for the doubleClick event and we send the event to a dummy handler <em></em></p>
<pre>&lt;mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" doubleClickEnabled="true"
 doubleClick="dummyClickHandler(event)"&gt;
&lt;mx:Script&gt;
&lt;![CDATA[
private function dummyClickHandler(event:Event):void
{
  // do nothing
}
]]&gt;
&lt;/mx:Script&gt;
&lt;mx:Label text="{data.artistName}" fontWeight="bold"/&gt;
&lt;mx:Label text="{data.artworkMedium}" fontStyle="italic"/&gt;
&lt;mx:Label text="{data.artworkSize}"/&gt;
&lt;/mx:VBox&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/flex-datagrid-itemrenderer-and-doubleclick-oh-my/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Updated Flex Qwerty Component</title>
		<link>http://www.kerkness.ca/updated-flex-qwerty-component/</link>
		<comments>http://www.kerkness.ca/updated-flex-qwerty-component/#comments</comments>
		<pubDate>Fri, 01 Aug 2008 00:24:00 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Components]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/blog/?p=51</guid>
		<description><![CDATA[I&#8217;ve made some updates and improvements to my Flex Qwerty Keyboard Component.
This version of the component is a little more tailored for a touch screen kiosk and is modled a little after the soft-touch keyboard you see on Apples&#8217; iPhone.  The main new features are shortcut buttons for typing &#8216;.com&#8217; and &#8216;.ca&#8217; (cause I&#8217;m [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve made some updates and improvements to my <a href="http://kerkness.blogspot.com/2008/02/flex-on-screen-qwerty-keyboard.html">Flex Qwerty Keyboard Component</a>.</p>
<p>This version of the component is a little more tailored for a touch screen kiosk and is modled a little after the soft-touch keyboard you see on Apples&#8217; iPhone.  The main new features are shortcut buttons for typing &#8216;.com&#8217; and &#8216;.ca&#8217; (cause I&#8217;m Canadian)  as well as a &#8216;Tab&#8217; button for tabbing through form fields.</p>
<p><a href="http://www.kerkness.ca/flexexamples/QwertyDemo/QwertyDemo.html">You can view a demo of the updated component here.</a></p>
<p><a href="http://www.kerkness.ca/flexexamples/QwertyDemo/srcview/index.html">You can view the source code for the updated component here.</a></p>
<p><span style="font-size:130%;"><b>How to Customize this Component<br /></b></span><br />I&#8217;ve had a few comments and questions about how to customize this component.  It should be fairly straight forward to do if all you want to do is add or modify how a button works.  Here are instructions on how to add an &#8216;Enter&#8217; or &#8216;Return&#8217; button to the keyboard.
<ol>
<li>First step is to physically add the button to the keyboard.  This can be done by adding a new object to one of the <i><b>keyRow</b></i> arrays in the <i>qwerty.mxml</i> file. Adding the following object to the end of the <i><b>keyRowC</b></i> array will add the button to the end of row 3 of the keyboard.
<pre>{label:'Return',w:100}</pre>
<p>The property &#8216;w&#8217; specifies that the button should be 100 pixels wide.  Alternatively you could set the property &#8216;flex&#8217; to &#8216;true&#8217; which would make the button take up as much available space as is available.</p>
</li>
<li>Next you need to instruct the component on how to handle the click event for this new button.  You do this by adding a condition to the switch statement in the function <i><b>handleKeyClick</b></i>().  Add the following condition for the new Return button.
<pre>case 'Return': this.inputControl.text += "n";break;</pre>
</li>
<li>Finally we need to modify the function which handles toggling between Upper and Lower case on the keyboard.  We don&#8217;t want our new button to be affected by this toggling so we will adjust this function to bypass our new button.
<p>In the function  <b><i>toggleUpperLower</i></b>()  edit the following line  from this&#8230;
<pre>if ( kidLabel == 'Tab' || kidLabel == 'Delete' ) continue;</pre>
<p>to this&#8230;
<pre>if ( kidLabel == 'Tab' || kidLabel == 'Delete' || kidLabel == 'Return' ) continue;</pre>
</li>
</ol>
<p>There you go, you should have a functional return button.  If you have any problems with this example please let me know in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/updated-flex-qwerty-component/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>
