<?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>The Flex Guy</title>
	<atom:link href="http://www.theflexguy.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.theflexguy.com</link>
	<description>I&#039;m addicted to Flex, this is my therapy.</description>
	<lastBuildDate>Sat, 18 Jun 2011 19:00:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>More thoughts on caching in Flex</title>
		<link>http://www.theflexguy.com/2011/06/18/more-thoughts-on-caching-in-flex/</link>
		<comments>http://www.theflexguy.com/2011/06/18/more-thoughts-on-caching-in-flex/#comments</comments>
		<pubDate>Sat, 18 Jun 2011 19:00:04 +0000</pubDate>
		<dc:creator>marty</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://www.theflexguy.com/?p=135</guid>
		<description><![CDATA[As I discussed previously, caching can have it&#8217;s advantages.  It makes referencing objects and binding much more straight forward.  Unfortunately, it comes at a performance cost.  Since I&#8217;ve been using caching, there are some important things to keep in mind when you use caching to make sure your data sticks around and your performance doesn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>As I discussed previously, caching can have it&#8217;s advantages.  It makes referencing objects and binding much more straight forward.  Unfortunately, it comes at a performance cost.  Since I&#8217;ve been using caching, there are some important things to keep in mind when you use caching to make sure your data sticks around and your performance doesn&#8217;t suffer any more than it has to.<span id="more-135"></span></p>
<p>If your data coming from the backend is always the same structure and all the properties of your value objects are populated, the following gotchas probably won&#8217;t apply.  For me, I&#8217;m working with some complex objects that can have a lot of data associated with it.  Because of that, the objects returned from the server can have different amounts of data populated.</p>
<p>Let&#8217;s say you&#8217;re working with Contacts again.  If your contact table had the following fields that matched to basic properties of your value object, you&#8217;d be fine.</p>
<p>contactId, firstName, lastName, phone, email, street1, street2, city, state, zip</p>
<p>But what if your object was a little more complex, like this:</p>
<p>contactId:int<br />
firstName:String<br />
lastName:String<br />
phone:String<br />
email:String<br />
address:Address<br />
notes:ArrayCollection of potentially long Strings<br />
purchases:ArrayCollection of Purchase<br />
referrals:ArrayCollection of Contact</p>
<p>Now, the API for the database might need to have more than a simple getContacts call.  Maybe you need a getSimpleContacts that just populates the id, name, and contact info.  This would be useful for getting the list of your contacts to put in a list.  Then when you select a contact, you could make a getFullContact call so that potentially large sets of data don&#8217;t have to be sent if they might not be needed.</p>
<p>If this were the case, you&#8217;d make the initial getSimpleContacts call to populate your list.  That would sync the objects to your data cache, with null values for the properties that are ArrayCollections.  Then as you select items, those null values would get overwritten with the real data in the cache.  Here&#8217;s the updateProperties method in the cache I&#8217;ve been using:</p>
<pre>private function updateProperties(itemA:Object, itemB:Object):void
{
     for each (var property:Property in info.getProperties())
     {
          if (property.readable &amp;&amp; property.writable)
          {
               property.setValue(itemA, property.getValue(itemB));
          }
     }
}</pre>
<p>It simply copies the new data from the new object (itemB) to the cached object (itemA).  That seems simple and elegant.</p>
<p>If you have the multiple APIs I talked about earlier, this can pose a problem.  Let&#8217;s say you open the application, getSimpleContacts is called to populate the basic list, you select a couple which shows all the contacts information so you use the getFullContact API.  The Contact object comes back with all the fields populated.  You sync the contact object using the cache and all the values are copied over to the cached object.  This is good because now, the object in the cache is fully populated so wherever you use it in your application, you&#8217;ve already got all the data.  Maybe in the time since you called getSimpleContacts and getFullContact, the phone number was updated, so that is updated in the cached contact as well.</p>
<p>Now, you go back to your list and to be sure you get any contacts that have been added since you last looked at the list, you make the getSimpleContacts call again.  The contacts come back and you sync each one with the cache so any updates will be reflected in the cached contacts.</p>
<p>Do you see a problem with the updateProperties method in this case?  The simple contact objects will still have all the property definitions, but since the API only returns the basic stuff, the new object will have null values for notes, purchases and referrals.  The updateProperties method will copy those null values over, clearing those populated values you had.</p>
<p>As long as the API will never return null values for properties the API provides, you could add a check to the if statement that only does the copy if the new value is not null:</p>
<pre>if (property.readable &amp;&amp; property.writable &amp;&amp; property.getValue(itemB) != null)
{
     property.setValue(itemA, property.getValue(itemB));
}</pre>
<p>If the data your server provides has a dateModified field that gets updated whenever any property of the object changes, you could make a custom cache for that dataType that compares the dateModified values of the old and new data.  If the dateModified is the same, you can skip copying over the basic data, since all APIs retrieve that in our example, and just copy the last three properties that might be null.  You could check for nulls as well to further reduce the work involved.  Skipping all that data copying if you know it wasn&#8217;t modified might seem trivial for one object but imagine if you retrieved 1000 contacts and synced them all with the cache.  Skipping the copying for the majority of your data would vastly improve the time it takes to process all those objects.</p>
<p>If you&#8217;re working on an enterprise application like I am, you&#8217;ll most likely appreciate the performance improvement and the caching mechanism I&#8217;ve described.  When you&#8217;re working with really big data sets, every little bit of processing time saved on each item can translate to noticeable improvements in the performance of your application.  Mobile applications also benefit from any performance improvement you can give it.</p>
<p>Do you have other ideas on caching or performance improvements when dealing with large amounts of data?  I&#8217;d love to hear them in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theflexguy.com/2011/06/18/more-thoughts-on-caching-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some thoughts on caching objects in Flex</title>
		<link>http://www.theflexguy.com/2011/06/17/some-thoughts-on-caching/</link>
		<comments>http://www.theflexguy.com/2011/06/17/some-thoughts-on-caching/#comments</comments>
		<pubDate>Fri, 17 Jun 2011 19:15:49 +0000</pubDate>
		<dc:creator>marty</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[caching]]></category>

		<guid isPermaLink="false">http://www.theflexguy.com/?p=134</guid>
		<description><![CDATA[The project I&#8217;ve been working on for a while now uses caching.  This means that the application will store the objects returned from the server in a DataCache and anytime objects are returned from the server, they are synced with the DataCache. This has the advantage of ensuring you&#8217;re always updating existing objects instead of [...]]]></description>
			<content:encoded><![CDATA[<p>The project I&#8217;ve been working on for a while now uses caching.  This means that the application will store the objects returned from the server in a DataCache and anytime objects are returned from the server, they are synced with the DataCache.<span id="more-134"></span> This has the advantage of ensuring you&#8217;re always updating existing objects instead of just swapping objects out.  The reason that can be an advantage is because if you have views bound to those objects or, especially, properties of those objects, the view won&#8217;t end up bound to an object that no longer is relevant.  This is an important concept so I&#8217;ll elaborate.</p>
<p>Lets say you have an application that tracks contacts.  The Contact object has a number of properties and some of the properties are custom classes themselves, such as an Address class.  Your application displays the contact information for the contact and you bind the address view to properties of the address property, like this:</p>
<pre>&lt;s:Label id="street1" text="{contact.address.street1}"/&gt;</pre>
<p>At first glance, most people would think this is just fine.  But here&#8217;s the scenario where this becomes an issue:</p>
<p>Let&#8217;s say the contact application doesn&#8217;t cache the contact objects.  Instead, you just overwrite the original data with the updated data.  It&#8217;s fast and simple.  There is probably a var called contacts in a model that the rest of your application references to display information about the contacts.</p>
<p>You&#8217;re open the application and on startup, it fetches all the contacts.  You select one of the contacts to view all the details.  The label that displays the street binds to the contact you selected and displays the data.  Then your application fetches the contacts from the server again, in case someone else has made changes to the contacts.  This contact (we&#8217;ll call him Henry) lived on River Rd. but recently moved to live on Oak St.  While your application was open, someone else updated his address.  Now, when the application on your computer goes out and fetches the contact again, it replaces that object with the new contact object.  It&#8217;s the same information but a different object in memory.</p>
<p>Here&#8217;s where the problem comes into play.  The Label was bound to the street1 property of the address property of the original contact object.  That object still exists with the original address and street1 values, and the Label is still bound to it.  The new object that has replaced it happens to have the same name and contactId, etc. but ActionScript doesn&#8217;t assume anything so the label ends up showing out of date information even though you&#8217;ve fetched the updated information.</p>
<p>If the contact object was cached, what would end up happening is that the Label would bind to a property of the contact which was stored in the cache.  When the new object came back from the server, it would be sent to the cache to be syncronized.  The cache would find the contact object with the same contactId and copy values from the new object to the one already in the cache.  Any properties that are not base objects like String, int, etc. would need to be cached and synced as well.  So your Address instance associated with Henry&#8217;s Contact instance would be updated in the cache too.  That way, the Contact instance is always the same object in memory and the Address instance used for the address property would always be the same object in memory as well.</p>
<p>This method takes some more time to keep the objects up to date but makes it much simpler when it comes to referencing those objects throughout your application.  The flip side would be to do the basic swap of data, but use events to notify the rest of the application that things have changed and carefully deal with that change appropriately by reassigning references wherever needed.  That way would be much more complex on your part but could potentially be much faster than using the cache.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theflexguy.com/2011/06/17/some-thoughts-on-caching/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ArrayCollection contains() uses your sort!</title>
		<link>http://www.theflexguy.com/2011/05/24/arraycollection-uses-your-sort/</link>
		<comments>http://www.theflexguy.com/2011/05/24/arraycollection-uses-your-sort/#comments</comments>
		<pubDate>Tue, 24 May 2011 23:21:33 +0000</pubDate>
		<dc:creator>marty</dc:creator>
				<category><![CDATA[Flex4]]></category>
		<category><![CDATA[ArrayCollection]]></category>
		<category><![CDATA[contains]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[sort]]></category>

		<guid isPermaLink="false">http://www.theflexguy.com/?p=132</guid>
		<description><![CDATA[Here&#8217;s another gotcha that took me a while to realize what was wrong. I was using an ArrayCollection to hold a collection of items. I had a custom sort applied since the items were typed objects that needed to be sorted according to certain, out-of-the-ordinary fields. In the sort method, I was comparing values and [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s another gotcha that took me a while to realize what was wrong.</p>
<p>I was using an ArrayCollection to hold a collection of items.  I had a custom sort applied since the items were typed objects that needed to be sorted according to certain, out-of-the-ordinary fields.  In the sort method, I was comparing values and returning either -1 or 1.</p>
<p><code>return itemA &gt; itemB ? -1 : 1;</code></p>
<p>From the docs for a compareFunction:</p>
<p style="padding-left: 30px;">The method used to compare items when sorting. If you specify this property, Flex ignores any <code>compareFunction</code> properties that you specify in the <code>ISortField</code> objects that you use in this class.</p>
<p style="padding-left: 30px;">The compare function must have the following signature:</p>
<pre style="padding-left: 30px;"><code>         function [name](a:Object, b:Object, fields:Array = null):int</code></pre>
<p style="padding-left: 30px;">This function must return the following value:</p>
<ul style="padding-left: 30px;">
<li>-1, if the <code>Object a</code> should appear before the <code>Object b</code> in the sorted sequence</li>
<li>0, if the <code>Object a</code> equals the <code>Object b</code></li>
<li>1, if the <code>Object a</code> should appear after the <code>Object b</code> in the sorted sequence</li>
</ul>
<p style="padding-left: 30px;">To return to the internal comparision function, set this value to <code>null</code>.</p>
<p>I decided that instead of returning 0 if they were the same, I would just let it stick it below the item. No big deal.</p>
<p>Later, when checking to see if an item was selected, I used the <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/collections/ListCollectionView.html#contains()">contains()</a> method to see if an item was in the ArrayCollection.  I quickly noticed that it wasn&#8217;t finding my item, even when I knew it was in the list.  Stepping through the code, and diving in to the Flex framework classes, I found that the contains() method uses the custom sort compare method to compare the item you&#8217;re looking for with the items in the list.  It determines it found the item when it gets 0 back from the compare function.  Since my custom compare method never returned 0, it never found the item.</p>
<p>Knowing this also helped me optimize the compare method for finding items.  Instead of thinking just in terms of whether one item goes before or after another item (or at the same level), I could also think about the comparisons in terms of checking to see if itemA <em>was </em>itemB.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theflexguy.com/2011/05/24/arraycollection-uses-your-sort/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t forget the down state</title>
		<link>http://www.theflexguy.com/2010/11/10/dont-forget-the-down-state/</link>
		<comments>http://www.theflexguy.com/2010/11/10/dont-forget-the-down-state/#comments</comments>
		<pubDate>Wed, 10 Nov 2010 00:23:21 +0000</pubDate>
		<dc:creator>marty</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.theflexguy.com/?p=124</guid>
		<description><![CDATA[I have been immersed in Flex 4 lately and had this issue come up.  It seems like it might be fairly easy to run into and isn&#8217;t entirely obvious at first so I&#8217;ll share.  I had a custom component that included buttons that weren&#8217;t registering click events. Here&#8217;s the scenario.  I created a custom component [...]]]></description>
			<content:encoded><![CDATA[<p>I have been immersed in Flex 4 lately and had this issue come up.  It seems like it might be fairly easy to run into and isn&#8217;t entirely obvious at first so I&#8217;ll share.  I had a custom component that included buttons that weren&#8217;t registering click events.</p>
<p>Here&#8217;s the scenario.  I created a custom component that contained a background rectangle for highlighting, a label to display the name of the item, a toggle button for expanding the item and a button for editing the item.  I won&#8217;t get into the specifics of what this component is for, but just stick to the high level concept.</p>
<p>[ [expandBtn:ToggleButton] [labelDisplay:Label] [editBtn:Button] ]</p>
<p>The component had a number of states:</p>
<pre>[SkinState("up")]
[SkinState("over")]
[SkinState("down")]
[SkinState("upAndSelected")]
[SkinState("overAndSelected")]
[SkinState("downAndSelected")]</pre>
<p>This is similar to the ToggleButton component in the SDK but didn&#8217;t need the disabled state.  I created mouseEvent handlers to take the rollOver, rollOut, mouseDown, mouseUp and click events so I could handle them appropriately, setting properties for the getCurrentSkinState() method to use and setting invalidateSkinState() after changing the properties.</p>
<p>In the components up state, I wanted just the label to show and then when the user hovers over the component, the expand and edit buttons show.  Using states, this is simple enough to accomplish in the skin for the component:</p>
<pre>
<div id="_mcePaste">&lt;s:states&gt;
  &lt;s:State name="up" /&gt;
  &lt;s:State name="over" stateGroups="overStates" /&gt;
  &lt;s:State name="down" stateGroups="downStates" /&gt;
  &lt;s:State name="upAndSelected" stateGroups="selectedStates" /&gt;
  &lt;s:State name="overAndSelected" stateGroups="overStates, selectedStates" /&gt;
  &lt;s:State name="downAndSelected" stateGroups="downStates, selectedStates" /&gt;
&lt;/s:states&gt;
...</div>
<div id="_mcePaste">&lt;s:ToggleButton id="expandBtn" includeIn="overStates" .../&gt;
</div>
<div id="_mcePaste">&lt;s:Label id="labelDisplay" ... /&gt;
</div>
<div id="_mcePaste">&lt;s:Button id="editBtn" includeIn="overStates" .../&gt;</div>
</pre>
<p>The ellipses indicate additional code that is irrelevant.</p>
<p>I added the click handlers for the buttons in the custom component so I could capture the clicks and dispatch my own custom event.</p>
<p>So this starts out looking fine.  The buttons show up when the mouse is hovered.  Great.  I click on the edit button and&#8230; nothing.  The click handler is never called.  Do you see why?</p>
<p>Hint: Because events like clicks travel the displayList, the surrounding component will react to the clicks of the buttons inside it too.</p>
<p>Ok, here&#8217;s the chain of events:</p>
<ol>
<li>The user presses the mouse button down over the edit button.</li>
<li>The edit button gets the mouseDown and enters it&#8217;s down state (if it has one).</li>
<li>The surrounding component gets the mouseDown and changes it&#8217;s skin state to the down state.</li>
<li>The edit button is not included in the down state, so it is removed.</li>
<li>The user releases the mouse button.</li>
<li>The surrounding component gets the mouseUp and returns to the over state.</li>
<li>The edit button is included in the over state so it appears again.</li>
</ol>
<p>Since the edit button wasn&#8217;t included in the down state, it never had a chance to react to a click event.  Click events occur when the user presses and releases the mouse button over a component and the edit button was not around for that whole chain of events.</p>
<p>Solution: Add the buttons into the downStates so they exist during the entire click action.  Problem solved.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theflexguy.com/2010/11/10/dont-forget-the-down-state/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AIR on Android</title>
		<link>http://www.theflexguy.com/2010/02/15/air-on-android/</link>
		<comments>http://www.theflexguy.com/2010/02/15/air-on-android/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 16:40:16 +0000</pubDate>
		<dc:creator>marty</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Adobe has made the announcement that AIR developers will be able to create applications for Android in late 2010! &#160;This is exciting news for AIR developers, since it opens up the mobile devices arena. &#160;AIR 2.0 will have support for multi-touch gestures, GPS, accelerometer and screen layout. Check out the AIR team blog to see [...]]]></description>
			<content:encoded><![CDATA[<p>Adobe has made the <a href="http://www.adobe.com/aboutadobe/pressroom/pressreleases/201002/021510FlashPlayerMWC.html">announcement</a> that AIR developers will be able to create applications for Android in late 2010! &nbsp;This is exciting news for AIR developers, since it opens up the mobile devices arena. &nbsp;AIR 2.0 will have support for multi-touch gestures, GPS, accelerometer and screen layout.</p>
<p>Check out the <a href="http://blogs.adobe.com/air/2010/02/preview_of_air_on_android.html">AIR team blog</a> to see their post on the subject.</p>
<p>Personally, I got the Motorola Droid for Christmas, and have been loving it. &nbsp;I&#8217;m quite excited to have the opportunity to develop applications for my phone using technologies I already love and know so well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theflexguy.com/2010/02/15/air-on-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Year, Improved Site</title>
		<link>http://www.theflexguy.com/2010/01/05/new-year-improved-site/</link>
		<comments>http://www.theflexguy.com/2010/01/05/new-year-improved-site/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 00:57:03 +0000</pubDate>
		<dc:creator>adminwp</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[domain registration]]></category>
		<category><![CDATA[dreamhost]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[promo]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[It&#8217;s a new year and that means a great excuse to make some site improvements. I feel like theflexguy.com has been a moving target ever since it&#8217;s conception. I was originally hosting my site on GoDaddy. I was fairly pleased, although they gave me a dirty feeling (have you seen their commercials?). Here&#8217;s some of [...]]]></description>
			<content:encoded><![CDATA[<div>It&#8217;s a new year and that means a great excuse to make some site improvements. I feel like theflexguy.com has been a moving target ever since it&#8217;s conception. I was originally hosting my site on GoDaddy. I was fairly pleased, although they gave me a dirty feeling (have you seen their commercials?). Here&#8217;s some of the changes I made for the new year, and why.</div>
<div>
<ul>
<li><a href="http://www.dreamhost.com/r.cgi?474250"><img style="float: right; margin-left: 5px;" src="http://images.dreamhost.com/rewards/125x125-a.gif" alt="" /></a>Hosting is now with <a href="http://www.dreamhost.com/r.cgi?474250">DreamHost</a> &#8211; I have some friends who use <a href="http://www.dreamhost.com/r.cgi?474250">DreamHost</a> and were very pleased. I must say, after dealing with them for a while now, I am quite pleased too. Their customer service is outstanding, they are generous with hosting and bandwidth and it&#8217;s all so very easy to use. If you decide to check them out, you can use this promo code <span class="highlight"> <strong>THEFLEXGUY_PROMO</strong> </span> to get $30 off a year of hosting and a free domain registration, courtesy of me &#8211; you&#8217;re welcome.</li>
<li>Comment system is easier to use now &#8211; I have been struggling with commenting since I use Joomla, and it&#8217;s not designed out of the box to have comments. I&#8217;m now using JComments to provide a simple interface that doesn&#8217;t require any registration.</li>
<li>Pretty URLs &#8211; this is something I have wanted for a long time but never could get to work right on GoDaddy. I finally have it working on <a href="http://www.dreamhost.com/r.cgi?474250">DreamHost</a>. Hopefully, it&#8217;ll be a lot easier to link to blog posts since the urls are a little more meaningful.</li>
</ul>
<div>I&#8217;m hoping to continue to improve the site so that users in the blogosphere can use it easier.</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.theflexguy.com/2010/01/05/new-year-improved-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Runaway ArrayCollections</title>
		<link>http://www.theflexguy.com/2009/08/09/runaway-arraycollections/</link>
		<comments>http://www.theflexguy.com/2009/08/09/runaway-arraycollections/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 04:51:27 +0000</pubDate>
		<dc:creator>adminwp</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Recently, I was racking my brain trying to solve a problem I had with a DataGrid not refreshing data. It took me a while to find the reason, so to help someone else with the same problem, I decided to write about it. Background I had an ArrayCollection of custom classes called Build. Those Build [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I was racking my brain trying to solve a problem I had with a DataGrid not refreshing data. It took me a while to find the reason, so to help someone else with the same problem, I decided to write about it.</p>
<h4>Background</h4>
<p>I had an ArrayCollection of custom classes called Build. Those Build classes each had an ArrayCollection another custom class, Item. Item is simply a class with properties key and value. The collection of Items is called metadata. In the Build, I created a getter to go grab the Item from it&#8217;s metadata with the key &#8220;STATUS&#8221;. This way, I can have the datagrid display the properties of each Build as well as the value associated with the metadata Item that has a key of STATUS. Make sense?</p>
<h4>Problem</h4>
<p>I&#8217;d receive a collection of Build objects back from a web service I was polling routinely. After the first call, I&#8217;d compare Build id&#8217;s and just update the existing Build with the updated information. The problem was, the DataGrid wasn&#8217;t showing the updates to the STATUS even though I could introspect with the debugger and see that it was getting updated.</p>
<h4>Solution</h4>
<p>I found that when I first created a Build instance, I was creating an ArrayCollection to hold the metadata and assigning listeners to watch for changes. I did that to keep it updated. After assigning the listeners, I would go about creating an ArrayCollection of Items and assigning that ArrayCollection to the metadata property of the Build. Did you catch that? My listeners were now listening to an orphaned ArrayCollection.</p>
<h4>Moral</h4>
<p>Be careful of when you create your properties and assign your listeners. I hope someone out there will be saved a few hours by this little tidbit. <img src='http://www.theflexguy.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.theflexguy.com/2009/08/09/runaway-arraycollections/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Four Considerations for Custom Components</title>
		<link>http://www.theflexguy.com/2009/08/09/four-considerations-for-custom-components/</link>
		<comments>http://www.theflexguy.com/2009/08/09/four-considerations-for-custom-components/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 03:36:34 +0000</pubDate>
		<dc:creator>adminwp</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[commitProperties]]></category>
		<category><![CDATA[component life cycle]]></category>
		<category><![CDATA[createChildren]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[measure]]></category>
		<category><![CDATA[uicomponent]]></category>
		<category><![CDATA[updateDisplayList]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[In this article, I&#8217;m going to discuss four considerations for developing high quality custom components: Portability Flexibility Performance Weight Using these considerations, you&#8217;ll be able to develop more professional, usable components. Even if I don&#8217;t think I will use my component in another project, I like to use these principles. Portability This refers to the [...]]]></description>
			<content:encoded><![CDATA[<p>In this article, I&#8217;m going to discuss four considerations for developing high quality custom components:</p>
<ol>
<li>Portability</li>
<li>Flexibility</li>
<li>Performance</li>
<li>Weight</li>
</ol>
<p>Using these considerations, you&#8217;ll be able to develop more professional, usable components. Even if I don&#8217;t think I will use my component in another project, I like to use these principles.</p>
<p><span id="more-107"></span></p>
<h3>Portability</h3>
<p>This refers to the components ability to stand on it&#8217;s own. As you build it, keep in mind that you want to create a &#8220;black-box&#8221;. It should have properties and styles that define what data it works with and how it looks, but if it requires other components or data to be present outside of the component, you won&#8217;t be able to use it in other projects without those other things. This is bad form. It&#8217;s not that hard to keep your components portable, so just provide getters and setters or public vars that can be your interface to the outside world and you&#8217;re good to go.</p>
<p>Documentation also improves the portability of your component, although this depends somewhat on the complexity of your component. If it&#8217;s really straight forward, then putting the work into lots of asdoc documentation is just going to waste your time. Instead, document the code really well (if you&#8217;re distributing it as code) or write a web page describing the basic inputs and outputs of the component.</p>
<h3>Flexibility</h3>
<p>Flexibility is the ability another developer has to customize your component without digging through your code. If you expose the right properties and styles, another user will be able to easily set those things most often changed. I say &#8220;most often&#8221; because you don&#8217;t want to go overboard with this one. Just because something can be changed, doesn&#8217;t mean it needs to have a property exposed to change it.</p>
<h3>Performance</h3>
<p>This doesn&#8217;t take much explanation, but unfortunately, understanding the meaning of good performance doesn&#8217;t make everyone understand how to implement it. You have to look for ways to reduce processor cycles where it isn&#8217;t necessary. Look for places that the exact same mathmatical calculation is being done over and over. Make the calculation once, store the value and use that instead. If you have an understanding of how computers work, under the hood, this will be much easier for you.</p>
<p>The importance of performance is dependent on how much processing it&#8217;s going to be doing. If it processes some data once, then just displays it, then you will be more likely to get away with sloppy performance than if your component is meant to process thousands of bits of data every time the screen refreshes. One way to squeeze extra performance out of your component may be to use the &#8220;garbage-in, garbage-out&#8221; rule. That means removing some of that error checking code you have sitting around and providing the disclaimer with the component that error checking should be done earlier on.</p>
<p>Sometimes, you can ask yourself &#8220;how much processing does this require?&#8221; Then ask yourself, &#8220;how much processing <em>should </em>this require?&#8221;</p>
<h3>Weight</h3>
<p>The weight of a component refers to the memory footprint it has for every instantiation that exists. Similar to performance, you might need to examine what the most common use of your component will be. If it will be on the stage in one place and fairly static, then the weight won&#8217;t be as much of a concern as the case where your component will exist hundreds of times (such as in the case of an item renderer).</p>
<p>Something else to consider when looking to drop the weight is feature bloat. As I mentioned in the flexibility section, you don&#8217;t want to go overboard with features. Think about what most people will use your component for. A component that does 5 useful things is better than one that does 400 things that 99% of the users will never use. The component will end up carrying around all that extra baggage whether they get used or not.</p>
<p>When your component is an extension of another class, take the time to find out how base your base class can be. A common mistake is to extend Canvas or some other container to hold something simple. Containers like Canvas and VBox have code to draw scrollbars, layout children in certain ways, and other baggage that may not be needed for your use case. UIComponent is the base class for all Flex components. If you subclass anything else up the inheritance chain, you won&#8217;t be able to display it, so if your component is visual, see if you can get away with subclassing UIComponent.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theflexguy.com/2009/08/09/four-considerations-for-custom-components/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chat widget</title>
		<link>http://www.theflexguy.com/2009/05/12/chat-widget/</link>
		<comments>http://www.theflexguy.com/2009/05/12/chat-widget/#comments</comments>
		<pubDate>Tue, 12 May 2009 21:24:00 +0000</pubDate>
		<dc:creator>adminwp</dc:creator>
				<category><![CDATA[Random]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[The little &#8220;Chat with Marty&#8221; module on the left side of my website is a cool little widget I got from Google. It allows visitors to your website to chat with you without revealing your google talk name, or requiring them to add you. You can get the widget from here: http://www.google.com/talk/service/badge/New Update: I removed [...]]]></description>
			<content:encoded><![CDATA[<p>The little &#8220;Chat with Marty&#8221; module on the left side of my website is a cool little widget I got from Google.  It allows visitors to your website to chat with you without revealing your google talk name, or requiring them to add you.</p>
<p>You can get the widget from here: <a href="http://www.google.com/talk/service/badge/New">http://www.google.com/talk/service/badge/New</a></p>
<p><span style="color: #ff0000;">Update</span>: I removed the chat widget after getting quite a few interruptions during my work day. �Word of advice, use with caution.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theflexguy.com/2009/05/12/chat-widget/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SearchInput control</title>
		<link>http://www.theflexguy.com/2009/05/08/searchinput-control/</link>
		<comments>http://www.theflexguy.com/2009/05/08/searchinput-control/#comments</comments>
		<pubDate>Fri, 08 May 2009 18:23:18 +0000</pubDate>
		<dc:creator>adminwp</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[There&#8217;s a couple of projects I&#8217;ve been working on lately, one of which is the BugQuash QuashBoard, that require a search input. I decided to quit duplicating some of the work I&#8217;m doing and create a SearchInput control that extends the TextInput control and wraps the search logic into a reusable component. The thought process [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a couple of projects I&#8217;ve been working on lately, one of which is the <a title="BugQuash - Register Now!" href="http://www.bugquash.com">BugQuash</a> QuashBoard, that require a search input. I decided to quit duplicating some of the work I&#8217;m doing and create a SearchInput control that extends the TextInput control and wraps the search logic into a reusable component.</p>
<p>The thought process went like this: I wanted a search field that when I typed, the datagrid (or whatever the data was displaying in) would filter out the rows that didn&#8217;t match the search terms. FilterFunctions do just that, but they don&#8217;t work on the DataGrid or List directly, they work on the dataProvider. The dataProvider must implement <a href="http://livedocs.adobe.com/flex/3/langref/mx/collections/ICollectionView.html">ICollectionView</a> to have a filterFunction applied to it. You can figure this out by searching for filterFunction and finding that it is defined in <a href="http://livedocs.adobe.com/flex/3/langref/mx/collections/ListCollectionView.html">ListCollectionView</a>. ListCollectionView defines the function because it&#8217;s in ICollectionView, which ListCollectionView implements. I programmed to an interface, not an implementation.</p>
<p><span id="more-105"></span></p>
<p>So, I extended the TextInput class and added a public property called <span style="font-family: 'courier new', courier;">dataProviderToFilter:ICollectionView</span> that will take the dataProvider it needs to work on, and another public property called <span style="font-family: 'courier new', courier;">propertiesToSearch:Array</span> that is an Array of Strings identifying the properties of the objects used for each row. It uses a no-arg constructor, which makes it available to use in MXML as well, just like the TextInput.</p>
<div class="rj_insertcode">
<div class="rj_insertcode_actionscript3">
<div class="actionscript3" style="border-collapse: collapse; width: 100%; border: 1px solid #054b6e; background: #f8f8f8;">
<pre style="margin: 0; background: none; vertical-align: top; padding: 0px 4px; font-size: 12px;"><span style="vertical-align: top;"><span style="color: #000000; font-weight: bold;">&lt;</span>theflexguy<span style="color: #000000; font-weight: bold;">:</span>SearchInput id=<span style="color: #990000;">"searchTxt"</span> <span style="color: #004993;">width</span>=<span style="color: #990000;">"100%"</span></span>
<span style="vertical-align: top;">	propertiesToSearch=<span style="color: #990000;">"{['artist','album','description']}"</span></span>
<span style="vertical-align: top;">	dataProviderToFilter=<span style="color: #990000;">"{my8TrackCollection}"</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre>
</div>
</div>
</div>
<p>Since I will probably use this a number of times, I&#8217;ll share it with the world. Once again, it&#8217;s not as hard as it seemed, which should be your mantra for Flex development.</p>
<div class="rj_insertcode">
<div class="rj_insertcode_actionscript3">
<table class="actionscript3" style="border-collapse: collapse; width: 100%; border: 1px solid #054b6e; background: #f8f8f8;" border="0">
<thead>
<tr>
<td style="background: #dddddd; color: #054b6e; padding: 2px 0px; text-align: center; font: bold italic 12px Verdana, Geneva, Arial, Helvetica, sans-serif;" colspan="2">SearchInput.as</td>
</tr>
</thead>
<tbody>
<tr class="li1">
<td style="width: 1px; background: #f0f0f0; vertical-align: top; color: #676f73; border-right: 1px dotted #dddddd; font-size: 12px; text-align: right;">
<pre style="margin: 0; background: none; vertical-align: top; padding: 0px 4px; font-size: 12px;">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
</pre>
</td>
<td style="margin: 0; background: none; vertical-align: top; padding: 0px 4px; font-size: 12px;">
<pre style="margin: 0; background: none; vertical-align: top; padding: 0px 4px; font-size: 12px;"><span style="vertical-align: top;"><span style="color: #9900cc; font-weight: bold;">package</span> com.theflexguy.controls</span>
<span style="vertical-align: top;"><span style="color: #000000;">{</span></span>
<span style="vertical-align: top;">	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<a href="http://www.google.com/search?q=event%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:event.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Event</span></a>;</span>
<span style="vertical-align: top;"></span>
<span style="vertical-align: top;">	<span style="color: #0033ff; font-weight: bold;">import</span> mx.collections.ICollectionView;</span>
<span style="vertical-align: top;">	<span style="color: #0033ff; font-weight: bold;">import</span> mx.controls.TextInput;</span>
<span style="vertical-align: top;"></span>
<span style="vertical-align: top;">	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> SearchInput extends TextInput</span>
<span style="vertical-align: top;">	<span style="color: #000000;">{</span></span>
<span style="vertical-align: top;">		<span style="color: #009900;">// dataProviderToFilter must implement ICollectionView so a</span></span>
<span style="vertical-align: top;">		<span style="color: #009900;">//  FilterFunction can be applied to it.</span></span>
<span style="vertical-align: top;">		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> dataProviderToFilter<span style="color: #000000; font-weight: bold;">:</span>ICollectionView;</span>
<span style="vertical-align: top;"></span>
<span style="vertical-align: top;">		<span style="color: #009900;">// propertiesToSearch is an Array of property names as Strings</span></span>
<span style="vertical-align: top;">		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> propertiesToSearch<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=array%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:array.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Array</span></a>;</span>
<span style="vertical-align: top;"></span>
<span style="vertical-align: top;">		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _searchWords<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=array%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:array.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Array</span></a>;</span>
<span style="vertical-align: top;"></span>
<span style="vertical-align: top;">		<span style="color: #009900;">// Splits the search text up using spaces to get the "words",</span></span>
<span style="vertical-align: top;">		<span style="color: #009900;">//  then sets the filterFunction</span></span>
<span style="vertical-align: top;">		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> searchTxt_changeHandler<span style="color: #000000;">(</span>event<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=event%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:event.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Event</span></a><span style="color: #000000;">)</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span></span>
<span style="vertical-align: top;">		<span style="color: #000000;">{</span></span>
<span style="vertical-align: top;">			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">(</span><span style="color: #004993;">text</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #990000;">""</span><span style="color: #000000;">)</span></span>
<span style="vertical-align: top;">			<span style="color: #000000;">{</span></span>
<span style="vertical-align: top;">				<span style="color: #009900;">// split up the input into individual "words", made </span></span>
<span style="vertical-align: top;">				<span style="color: #009900;">// upperCase so it's case insensitive</span></span>
<span style="vertical-align: top;">				_searchWords = <span style="color: #004993;">text</span>.<span style="color: #004993;">toUpperCase</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>.<span style="color: #004993;">split</span><span style="color: #000000;">(</span><span style="color: #990000;">" "</span><span style="color: #000000;">)</span>;</span>
<span style="vertical-align: top;"></span>
<span style="vertical-align: top;">				<span style="color: #009900;">// check to see if the last item is a 0 length String, this</span></span>
<span style="vertical-align: top;">				<span style="color: #009900;">// would be the case if the last character typed was a space</span></span>
<span style="vertical-align: top;">				<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">(</span>_searchWords<span style="color: #000000;">[</span>_searchWords.<span style="color: #004993;">length</span> <span style="color: #000000; font-weight: bold;">-</span> <span style="color: #000000; font-weight: bold;">1</span><span style="color: #000000;">]</span> == <span style="color: #990000;">""</span><span style="color: #000000;">)</span></span>
<span style="vertical-align: top;">				<span style="color: #000000;">{</span></span>
<span style="vertical-align: top;">					<span style="color: #009900;">// if it is "", remove it</span></span>
<span style="vertical-align: top;">					_searchWords.<span style="color: #004993;">pop</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>;</span>
<span style="vertical-align: top;">				<span style="color: #000000;">}</span></span>
<span style="vertical-align: top;">				<span style="color: #009900;">// set the filterFunction</span></span>
<span style="vertical-align: top;">				dataProviderToFilter.filterFunction = filterForSearch;</span>
<span style="vertical-align: top;">			<span style="color: #000000;">}</span></span>
<span style="vertical-align: top;">			<span style="color: #0033ff; font-weight: bold;">else</span></span>
<span style="vertical-align: top;">			<span style="color: #000000;">{</span></span>
<span style="vertical-align: top;">				<span style="color: #009900;">// the user removed the text so remove the filterFunction</span></span>
<span style="vertical-align: top;">				dataProviderToFilter.filterFunction = <span style="color: #0033ff; font-weight: bold;">null</span>;</span>
<span style="vertical-align: top;">			<span style="color: #000000;">}</span></span>
<span style="vertical-align: top;"></span>
<span style="vertical-align: top;">			<span style="color: #009900;">// refresh the dataProvider</span></span>
<span style="vertical-align: top;">			dataProviderToFilter.refresh<span style="color: #000000;">(</span><span style="color: #000000;">)</span>;</span>
<span style="vertical-align: top;">		<span style="color: #000000;">}</span></span>
<span style="vertical-align: top;"></span>
<span style="vertical-align: top;">		<span style="color: #009900;">// Uses the searchWords array to search the summary and components</span></span>
<span style="vertical-align: top;">		<span style="color: #009900;">//  fields of each row for each item in the array.</span></span>
<span style="vertical-align: top;">		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> filterForSearch<span style="color: #000000;">(</span>item<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=object%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:object.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Object</span></a><span style="color: #000000;">)</span><span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=boolean%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:boolean.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Boolean</span></a></span>
<span style="vertical-align: top;">		<span style="color: #000000;">{</span></span>
<span style="vertical-align: top;">			<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">match</span><span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=boolean%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:boolean.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Boolean</span></a> = <span style="color: #0033ff; font-weight: bold;">false</span></span>
<span style="vertical-align: top;">			<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #0033ff; font-weight: bold;">each</span><span style="color: #000000;">(</span><span style="color: #6699cc; font-weight: bold;">var</span> s<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">String</span></a> <span style="color: #0033ff; font-weight: bold;">in</span> _searchWords<span style="color: #000000;">)</span></span>
<span style="vertical-align: top;">			<span style="color: #000000;">{</span></span>
<span style="vertical-align: top;">				<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #0033ff; font-weight: bold;">each</span><span style="color: #000000;">(</span><span style="color: #6699cc; font-weight: bold;">var</span> p<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">String</span></a> <span style="color: #0033ff; font-weight: bold;">in</span> propertiesToSearch<span style="color: #000000;">)</span></span>
<span style="vertical-align: top;">				<span style="color: #000000;">{</span></span>
<span style="vertical-align: top;">					<span style="color: #009900;">// check each property for the word using </span></span>
<span style="vertical-align: top;">					<span style="color: #009900;">// toUpperCase so it's case insensitive</span></span>
<span style="vertical-align: top;">					<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">(</span>item<span style="color: #000000;">[</span>p<span style="color: #000000;">]</span>.<span style="color: #004993;">toString</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>.<span style="color: #004993;">toUpperCase</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>.<span style="color: #004993;">match</span><span style="color: #000000;">(</span>s<span style="color: #000000;">)</span><span style="color: #000000;">)</span></span>
<span style="vertical-align: top;">					<span style="color: #000000;">{</span></span>
<span style="vertical-align: top;">						<span style="color: #004993;">match</span> = <span style="color: #0033ff; font-weight: bold;">true</span>;</span>
<span style="vertical-align: top;">						<span style="color: #0033ff; font-weight: bold;">break</span>;</span>
<span style="vertical-align: top;">					<span style="color: #000000;">}</span></span>
<span style="vertical-align: top;">				<span style="color: #000000;">}</span></span>
<span style="vertical-align: top;">			<span style="color: #000000;">}</span></span>
<span style="vertical-align: top;">			<span style="color: #0033ff; font-weight: bold;">return</span> <span style="color: #004993;">match</span>;</span>
<span style="vertical-align: top;">		<span style="color: #000000;">}</span></span>
<span style="vertical-align: top;"></span>
<span style="vertical-align: top;">		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> SearchInput<span style="color: #000000;">(</span><span style="color: #000000;">)</span></span>
<span style="vertical-align: top;">		<span style="color: #000000;">{</span></span>
<span style="vertical-align: top;">			<span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>;</span>
<span style="vertical-align: top;">			<span style="color: #004993;">addEventListener</span><span style="color: #000000;">(</span><a href="http://www.google.com/search?q=event%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:event.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Event</span></a>.<span style="color: #004993;">CHANGE</span>, searchTxt_changeHandler<span style="color: #000000;">)</span>;</span>
<span style="vertical-align: top;">		<span style="color: #000000;">}</span></span>
<span style="vertical-align: top;"></span>
<span style="vertical-align: top;">	<span style="color: #000000;">}</span></span>
<span style="vertical-align: top;"><span style="color: #000000;">}</span></span>
<span style="vertical-align: top;"></span></pre>
</td>
</tr>
</tbody>
</table>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.theflexguy.com/2009/05/08/searchinput-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

