<?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>Blue Flex</title>
	<atom:link href="http://kennethsutherland.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://kennethsutherland.com</link>
	<description>Flex with a hint of cool</description>
	<lastBuildDate>Wed, 18 Apr 2012 21:22:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>Searching a string &#8211; do you need to start with a period?</title>
		<link>http://kennethsutherland.com/2012/04/18/searching-a-string-do-you-need-to-start-with-a-period/</link>
		<comments>http://kennethsutherland.com/2012/04/18/searching-a-string-do-you-need-to-start-with-a-period/#comments</comments>
		<pubDate>Wed, 18 Apr 2012 21:20:09 +0000</pubDate>
		<dc:creator>Kenneth</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[period]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[string]]></category>

		<guid isPermaLink="false">http://kennethsutherland.com/?p=817</guid>
		<description><![CDATA[Today I had to write some code to search for text that matched various file extensions, this should have been a no brainer of a task. But like some things that sound stupidly simple it caught me out. If you have a string and you use the search method then when it finds something it [...]]]></description>
			<content:encoded><![CDATA[<p>Today I had to write some code to search for text that matched various file extensions, this should have been a <em>no brainer</em> of a task. But like some things that sound stupidly simple it caught me out.</p>
<p>If you have a string and you use the search method then when it finds something it will return the position. If it doesn&#8217;t then it will return -1. So far so good.</p>
<p>Now I could go into huge detail (I did, but it ended up to wordy/dull, so I just deleted it!).<br />
So if you <strong>EVER </strong>have to search for a string and your string starts with a period &#8216;.&#8217; then add a double backslash &#8216;\\&#8217;.<br />
If you don&#8217;t then the period will match anything! e.g. you want to match &#8216;.ra&#8217; and the string contains the word brain then &#8216;brain&#8217;.search( &#8216;.ra&#8217; )<strong> DOES NOT</strong> return -1!</p>
<p>use &#8216;\\.ra&#8217; for correct results.</p>
<p>Not sure why &#8216;.ra&#8217; doesn&#8217;t work, maybe it&#8217;s treating the string like a regEx, I know search can take both a string and a regEx so maybe its not looking at its type and guessing that it should be a regEx?? You can&#8217;t step into the code either to see why, so just use the \\</p>
<p>Very annoying!</p>
<table width="100%">
<tr>
<td>
<p style="text-align: left;">
<a title="Simple tip #5" href="http://kennethsutherland.com/2011/08/03/simple-tip-5-create-function-to-call-any-function-with-unknown-args/" target="_self">Previous Tip<br />
</a>
</p>
</td>
<td>
<p style="text-align: right;">
<p></a>
</p>
</td>
</tr>
</table>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-7396620608505330";
google_ad_slot = "1277482570";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://kennethsutherland.com/2012/04/18/searching-a-string-do-you-need-to-start-with-a-period/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Good day in the office &#8211; 1000&#8242;s of mobile apps built in a few hours!</title>
		<link>http://kennethsutherland.com/2012/03/19/good-day-in-the-office-1000s-of-mobile-apps-built-in-a-few-hours/</link>
		<comments>http://kennethsutherland.com/2012/03/19/good-day-in-the-office-1000s-of-mobile-apps-built-in-a-few-hours/#comments</comments>
		<pubDate>Mon, 19 Mar 2012 11:15:00 +0000</pubDate>
		<dc:creator>Kenneth</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[off topic]]></category>

		<guid isPermaLink="false">http://kennethsutherland.com/?p=794</guid>
		<description><![CDATA[Yeah its been ages since I&#8217;ve last blogged any code articles (got a few 1/2 done &#8211; honest!). Just been very busy in the past several months working with the crew from Jampot. Anyway check out this article where we headline in Engadget. Shows off our new product which can let you build an app [...]]]></description>
			<content:encoded><![CDATA[<p>Yeah its been ages since I&#8217;ve last blogged any code articles (got a few 1/2 done &#8211; honest!). Just been very busy in the past several months working with the crew from <a href="http://www.jampot.ie/2012/03/theappbuilder-on-engadget/"  target="_blank">Jampot</a>. Anyway check out <a href="http://engt.co/y1drnL" target="_blank">this article</a> where we headline in Engadget. Shows off our new product which can let you build an app in minutes and get it installed on your phone. </p>
<p><a href="http://engt.co/y1drnL"  target="_blank"><img src="http://kennethsutherland.com/wordpress1/wp-content/uploads/2012/03/Engadget-team.jpg" alt="Jampot crew" title="Engadget-team" width="600" height="450" class="aligncenter size-full wp-image-800" /></a></p>
<p>Check out the actual Engadget article <a href="http://engt.co/y1drnL"  target="_blank">here.</a><br />
Check out the fab Jampot team <a href="http://www.jampot.ie/2012/03/theappbuilder-on-engadget/"  target="_blank">here <img src='http://kennethsutherland.com/wordpress1/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </a><br />
And of course check out this to <a href="http://www.theappbuilder.com/" target="_blank">build an app and get it on your phone in minutes.</a></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-7396620608505330";
google_ad_slot = "1277482570";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://kennethsutherland.com/2012/03/19/good-day-in-the-office-1000s-of-mobile-apps-built-in-a-few-hours/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>App story &#8211; on BBC site. Catch it live at MAX 2011</title>
		<link>http://kennethsutherland.com/2011/09/28/app-story-on-bbc-site-catch-it-live-at-max-2011/</link>
		<comments>http://kennethsutherland.com/2011/09/28/app-story-on-bbc-site-catch-it-live-at-max-2011/#comments</comments>
		<pubDate>Wed, 28 Sep 2011 14:12:28 +0000</pubDate>
		<dc:creator>Kenneth</dc:creator>
				<category><![CDATA[Flex 4]]></category>
		<category><![CDATA[mobile]]></category>

		<guid isPermaLink="false">http://kennethsutherland.com/?p=753</guid>
		<description><![CDATA[The application that I&#8217;m working on with the guys at Jampot has made the BBC news. Check out the article from the BBC. http://www.bbc.co.uk/news/uk-northern-ireland-15075450 Also the guys are heading over to the Adobe Max 2011 conference so you&#8217;ll be able to see it live and see how easy it is to create a mobile app [...]]]></description>
			<content:encoded><![CDATA[<p>The application that I&#8217;m working on with the guys at <a title="Jampot" href="http://www.jampot.ie/" target="_blank">Jampot </a>has made the BBC news.  Check out the article from the BBC.<br />
<a title="http://www.bbc.co.uk/news/uk-northern-ireland-15075450" href="http://www.bbc.co.uk/news/uk-northern-ireland-15075450" target="_blank"> http://www.bbc.co.uk/news/uk-northern-ireland-15075450</a></p>
<p>Also the guys are heading over to the<strong> Adobe Max 2011</strong> conference so you&#8217;ll be able to see it live and see how easy it is to create a mobile app for all mobile platforms.</p>
<p><a href="http://www.theappbuilder.com/" target="_blank"><img class="aligncenter size-full wp-image-758" title="TheAppBuilder" src="http://kennethsutherland.com/wordpress1/wp-content/uploads/2011/09/the_app_builder.jpg" alt="" width="480" height="480" /></a></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-7396620608505330";
google_ad_slot = "1277482570";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://kennethsutherland.com/2011/09/28/app-story-on-bbc-site-catch-it-live-at-max-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iOS &#8211; Mobile dev, make sure you flush when you&#8217;re done.</title>
		<link>http://kennethsutherland.com/2011/09/07/ios-mobile-dev-make-sure-you-flush-when-youre-done/</link>
		<comments>http://kennethsutherland.com/2011/09/07/ios-mobile-dev-make-sure-you-flush-when-youre-done/#comments</comments>
		<pubDate>Wed, 07 Sep 2011 20:05:59 +0000</pubDate>
		<dc:creator>Kenneth</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Flex 4]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://kennethsutherland.com/?p=739</guid>
		<description><![CDATA[Developing for Apple&#8217;s devices can throw up a few little quirks that don&#8217;t happen when using Android devices. This one happens if you are using shared objects to store information between sessions. Basically, you should always call the flush mechanism whether you are adding more data to the shared object or if you are deleting [...]]]></description>
			<content:encoded><![CDATA[<p>Developing for Apple&#8217;s devices can throw up a few little quirks that don&#8217;t happen when using Android devices.</p>
<p>This one happens if you are using shared objects to store information between sessions.<br />
Basically, you should always call the flush mechanism whether you are adding more data to the shared object or if you are deleting something from the shared object.</p>
<p>What you find is if you have a shared object &#8216;shared&#8217; with a value shared.data.firstValue = &#8220;something&#8221;, then you delete that value using</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">delete</span> shared.<span style="color: #0066CC;">data</span>.<span style="color: #006600;">firstValue</span>;</pre></div></div>

<p> if you try to access the value firstValue you will get <em><strong>null</strong></em>.<br />
<em>This is exactly what I&#8217;d expect.</em></p>
<p>Then lets say you exit the app and you either kill the app from running in the background or iOS stops it. Then the next time you load the app and access the shared object shared.data.firstValue you will get back &#8220;something&#8221; and not null.</p>
<p><strong>You must flush the shared object for it to be stored locally, otherwise when the app is killed, the local storage will not have been updated.</strong></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-7396620608505330";
google_ad_slot = "1277482570";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://kennethsutherland.com/2011/09/07/ios-mobile-dev-make-sure-you-flush-when-youre-done/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updating bindings when you only change a property inside an Object</title>
		<link>http://kennethsutherland.com/2011/08/30/updating-bindings-when-you-only-change-a-property-inside-an-object/</link>
		<comments>http://kennethsutherland.com/2011/08/30/updating-bindings-when-you-only-change-a-property-inside-an-object/#comments</comments>
		<pubDate>Tue, 30 Aug 2011 21:08:23 +0000</pubDate>
		<dc:creator>Kenneth</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[bindingManager]]></category>
		<category><![CDATA[Flex 3]]></category>
		<category><![CDATA[flex 4]]></category>

		<guid isPermaLink="false">http://kennethsutherland.com/?p=705</guid>
		<description><![CDATA[Its quite a common thing with Flex and actionscript projects to create an Object and inside that object it will have many properties.  Something in your view will be bound to the object so that the view changes with the object. So long as you change the entire object this will work fine. Where this [...]]]></description>
			<content:encoded><![CDATA[<p>Its quite a common thing with Flex and actionscript projects to create an Object and inside that object it will have many properties.  Something in your view will be bound to the object so that the view changes with the object. So long as you change the entire object this will work fine.</p>
<p>Where this doesn&#8217;t work is if you change a property inside the object.</p>
<p>So if we have something like this</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&#91;</span>Bindable<span style="color: #66cc66;">&#93;</span>			
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> myObject : ObjectDataVO;
&nbsp;
<span style="color: #66cc66;">&lt;</span>view:SomeComponent
...
<span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;{ myObject }&quot;</span>
...
<span style="color: #66cc66;">/&gt;</span></pre></div></div>

<p>When we set myObject to something the view component gets updated (great so far).<br />
Lets say the myObject has a property text and the view component uses this to display some visual label, then somewhere in the app I change that property, myObject.text = &#8220;something else&#8221;;<br />
The binding will not trigger as I haven&#8217;t actually changed the myObject, just a property inside it.</p>
<p>So how do we fire the binding manually? Well there is the <strong>BindingManager </strong>class (note this is an <em>excluded </em>class so you&#8217;ll not see it in the autocomplete ).<br />
So in this example if I changed the myObject.text property then I could call</p>
<p><span style="text-decoration: underline;"> BindingManager.executeBindings( this, &#8216;myObject.text&#8217;, myObject );</span></p>
<p>This would fire of the binding as if the actual myObject had changed so anything listening in will now get updated.</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-7396620608505330";
google_ad_slot = "1277482570";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://kennethsutherland.com/2011/08/30/updating-bindings-when-you-only-change-a-property-inside-an-object/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Cross domain policy &#8211; Not to be used for release!</title>
		<link>http://kennethsutherland.com/2011/08/29/cross-domain-policy-not-to-be-used-for-release/</link>
		<comments>http://kennethsutherland.com/2011/08/29/cross-domain-policy-not-to-be-used-for-release/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 14:29:15 +0000</pubDate>
		<dc:creator>Kenneth</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://kennethsutherland.com/?p=708</guid>
		<description><![CDATA[Sometimes I like to put something up on my blog that&#8217;s more as of a bookmark for myself as I know I&#8217;ll want to look it up at some point.  So what I&#8217;ve got here is a slack, open cross domain policy. DO NOT USE THIS IN YOUR PRODUCTION CODE (unless you really need to [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes I like to put something up on my blog that&#8217;s more as of a bookmark for myself as I know I&#8217;ll want to look it up at some point.  So what I&#8217;ve got here is a slack, open cross domain policy.</p>
<p><strong>DO NOT USE THIS IN YOUR PRODUCTION CODE</strong><br />
<strong> </strong><em> (unless you really need to and understand why you shouldn&#8217;t)</em></p>
<p>This will get rid of any security issues you may be having while in development.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #00bbdd;">&lt;!DOCTYPE cross-domain-policy SYSTEM</span>
<span style="color: #00bbdd;"> &quot;http://www.adobe.com/xml/dtds/cross-domain-policy.dtd&quot;&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;cross-domain-policy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;site-control</span> <span style="color: #000066;">permitted-cross-domain-policies</span>=<span style="color: #ff0000;">&quot;all&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;allow-access-from</span> <span style="color: #000066;">domain</span>=<span style="color: #ff0000;">&quot;*&quot;</span> <span style="color: #000066;">secure</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;allow-http-request-headers-from</span> <span style="color: #000066;">domain</span>=<span style="color: #ff0000;">&quot;*&quot;</span></span>
<span style="color: #009900;"> <span style="color: #000066;">headers</span>=<span style="color: #ff0000;">&quot;*&quot;</span> <span style="color: #000066;">secure</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/cross-domain-policy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-7396620608505330";
google_ad_slot = "1277482570";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://kennethsutherland.com/2011/08/29/cross-domain-policy-not-to-be-used-for-release/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IconItemRenderer and LabelItemRenderer, separator lines hardcoded!</title>
		<link>http://kennethsutherland.com/2011/08/23/iconitemrenderer-and-labelitemrenderer-separator-lines-hardcoded/</link>
		<comments>http://kennethsutherland.com/2011/08/23/iconitemrenderer-and-labelitemrenderer-separator-lines-hardcoded/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 20:41:55 +0000</pubDate>
		<dc:creator>Kenneth</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[IconItemRenderer]]></category>

		<guid isPermaLink="false">http://kennethsutherland.com/?p=696</guid>
		<description><![CDATA[Working on a mobile project I needed to create a renderer for a list, so I choose to look at the IconItemRenderer which extends the LabelItemRenderer. These have been optimised for mobile use so it seemed a reasonable place to start. On the whole they seem like good classes to use, but if you&#8217;ve ever [...]]]></description>
			<content:encoded><![CDATA[<p>Working on a mobile project I needed to create a renderer for a list, so I choose to look at the IconItemRenderer which extends the LabelItemRenderer. These have been optimised for mobile use so it seemed a reasonable place to start. On the whole they seem like good classes to use, but if you&#8217;ve ever worked with the Datagrid/DataGridBase in the past you will probably know about the white square which comes about from the hardcoded #FFFFFF values inside the DataGridBase!</p>
<p>Well the IconItemRenderer and LabelItemRenderer have a similar issue. So lets just say you create a list and you wish to skin the list exactly how you like or use it in a tile layout or something other than vertical then you will find some lines above and below your renderers which look out of place.  You can&#8217;t get rid of them no matter what property styles you set.</p>
<p>The fix is pretty straight forward but why does there have to be some hardcoded values in something that is meant to be very versatile?</p>
<p>So inside the LabelItemRenderer around lines 881 you will see the following. It uses these values to draw separators whether you like it or not.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #009900; font-style: italic;">// separators are a highlight on the top and shadow on the bottom</span>
topSeparatorColor = 0xFFFFFF<span style="color: #000066; font-weight: bold;">;</span>
topSeparatorAlpha = <span style="color: #000066; font-weight: bold;">.</span>3<span style="color: #000066; font-weight: bold;">;</span>
bottomSeparatorColor = 0x000000<span style="color: #000066; font-weight: bold;">;</span>
bottomSeparatorAlpha = <span style="color: #000066; font-weight: bold;">.</span>3<span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

<p>So the quickest way of dealing with this is to override the drawBackground function in your own class which is created in LabelItemRenderer. This doesn&#8217;t get called from IconItemRenderer so you can quite simple copy the entire function and just remove the separator chunk and do not call super from your function which overrides the drawBackground.</p>
<p>Better still would be to change the hard coded values to styles from a CSS file.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> topSeparatorColor <span style="color: #000066; font-weight: bold;">:</span> <span style="color: #004993;">uint</span> = <span style="color: #004993;">getStyle</span><span style="color: #000000;">&#40;</span> <span style="color: #990000;">'topSeparatorColor'</span> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #6699cc; font-weight: bold;">var</span> topSeparatorAlpha <span style="color: #000066; font-weight: bold;">:</span> <span style="color: #004993;">Number</span> = <span style="color: #004993;">getStyle</span><span style="color: #000000;">&#40;</span> <span style="color: #990000;">'topSeparatorAlpha'</span> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
topSeparatorAlpha = <span style="color: #004993;">isNaN</span><span style="color: #000000;">&#40;</span> topSeparatorAlpha <span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">?</span> <span style="color: #000000; font-weight:bold;">1</span> <span style="color: #000066; font-weight: bold;">:</span> topSeparatorAlpha<span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

<p>If you&#8217;re setting a Number just remember to check for NaN&#8217;s in case you haven&#8217;t set a style, uints default to 0 anyway.</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-7396620608505330";
google_ad_slot = "1277482570";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://kennethsutherland.com/2011/08/23/iconitemrenderer-and-labelitemrenderer-separator-lines-hardcoded/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple tip #5 Create function to call any function with unknown args</title>
		<link>http://kennethsutherland.com/2011/08/03/simple-tip-5-create-function-to-call-any-function-with-unknown-args/</link>
		<comments>http://kennethsutherland.com/2011/08/03/simple-tip-5-create-function-to-call-any-function-with-unknown-args/#comments</comments>
		<pubDate>Wed, 03 Aug 2011 20:33:38 +0000</pubDate>
		<dc:creator>Kenneth</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://kennethsutherland.com/?p=674</guid>
		<description><![CDATA[The other day I wanted to create a function in a class that would take a Function as a parameter and an Array of arguments.  Much like callLater() does, but not doing the whole queuing thing until the next frame. So how do you call a function that may have any number of arguments. Well [...]]]></description>
			<content:encoded><![CDATA[<p>The other day I wanted to create a function in a class that would take a Function as a parameter and an Array of arguments.  Much like callLater() does, but not doing the whole queuing thing until the next frame.</p>
<p>So how do you call a function that may have any number of arguments. Well here is the code and it should speak for itself.</p>
<p><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre;"> </span></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"> <span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> checkSomethingThenCallOtherFunction<span style="color: #000000;">&#40;</span>
    <span style="color: #004993;">method</span> <span style="color: #000066; font-weight: bold;">:</span> <span style="color: #004993;">Function</span><span style="color: #000066; font-weight: bold;">,</span> args <span style="color: #000066; font-weight: bold;">:</span> <span style="color: #004993;">Array</span> = <span style="color: #0033ff; font-weight: bold;">null</span> <span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">void</span>
 <span style="color: #000000;">&#123;</span>
    <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> something<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">length</span> <span style="color: #000066; font-weight: bold;">&amp;</span>lt<span style="color: #000066; font-weight: bold;">;</span> someMaxLimit <span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        <span style="color: #004993;">method</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">apply</span><span style="color: #000000;">&#40;</span> <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000066; font-weight: bold;">,</span> args <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #000000;">&#125;</span>
    <span style="color: #0033ff; font-weight: bold;">else</span>
    <span style="color: #000000;">&#123;</span>
        <span style="color: #009900; font-style: italic;">//do something else</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>So how easy is that? Pass in the function and an array of arguments, that&#8217;s all.</p>
<table width="100%">
<tr>
<td>
<p style="text-align: left;">
<a title="Simple tip #4" href="http://kennethsutherland.com/2010/09/17/simple-tip-4-gotach-datagrid-borders/" target="_self">Previous Tip<br />
</a>
</p>
</td>
<td>
<p style="text-align: right;">
<a title="Simple tip #6" href="http://kennethsutherland.com/2012/04/18/searching-a-string-do-you-need-to-start-with-a-period/" target="_self">Next Tip
</p>
</td>
</tr>
</table>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-7396620608505330";
google_ad_slot = "1277482570";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://kennethsutherland.com/2011/08/03/simple-tip-5-create-function-to-call-any-function-with-unknown-args/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linear and Radial gradients &#8211; visually explained</title>
		<link>http://kennethsutherland.com/2011/02/24/linear-and-radial-gradients-visually-explained/</link>
		<comments>http://kennethsutherland.com/2011/02/24/linear-and-radial-gradients-visually-explained/#comments</comments>
		<pubDate>Thu, 24 Feb 2011 15:53:17 +0000</pubDate>
		<dc:creator>Kenneth</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Flex 4]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[explorer]]></category>
		<category><![CDATA[flex 4]]></category>
		<category><![CDATA[gradient]]></category>
		<category><![CDATA[linear]]></category>
		<category><![CDATA[radial]]></category>

		<guid isPermaLink="false">http://kennethsutherland.com/?p=633</guid>
		<description><![CDATA[I was playing around with some code recently (Flex 4 code) and I went to create a simple background and not having Catalyst or similar to output a fxg file I went to create my own gradients with some code. After a couple of goes and not getting anything resembeling what I expect I decided [...]]]></description>
			<content:encoded><![CDATA[<p>I was playing around with some code recently (Flex 4 code) and I went to create a simple background and not having Catalyst or similar to output a fxg file I went to create my own gradients with some code. After a couple of goes and not getting anything resembeling what I expect I decided to write a quick explorer.</p>
<p>I&#8217;ve done something similar ages ago with flex 3, so I thought I&#8217;d do this with flex 4 and perhaps look to expand it as an example of reskining an app with different skins. (source code may follow when I do this)  So here is the first step. A simple explorer to help understand the values that are used to make a Linear or Radial gradient along with the entries that make the look how they look.</p>
<p>I think it should be self explanatory, but if not just post a comment.</p>
<p>Follow the <a title="Flex 4, gradients explorer" href="http://www.kennethsutherland.com/flex/graphic_flex_4/GradientFlex4.html" target="_newtab">link to open the explorer</a>.</p>
<p><a href="http://www.kennethsutherland.com/flex/graphic_flex_4/GradientFlex4.html" target="_newtab" ><img class="aligncenter size-full wp-image-654" title="Explorer screenshot" src="http://kennethsutherland.com/wordpress1/wp-content/uploads/2011/02/flex4Gradient1.png" alt="Explorer screenshot" width="431" height="378" /></a></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-7396620608505330";
google_ad_slot = "1277482570";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://kennethsutherland.com/2011/02/24/linear-and-radial-gradients-visually-explained/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Additional compiler arguments &#8211; debug only code</title>
		<link>http://kennethsutherland.com/2011/01/07/additional-compiler-arguments-debug-only-code/</link>
		<comments>http://kennethsutherland.com/2011/01/07/additional-compiler-arguments-debug-only-code/#comments</comments>
		<pubDate>Fri, 07 Jan 2011 22:24:20 +0000</pubDate>
		<dc:creator>Kenneth</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://kennethsutherland.com/?p=618</guid>
		<description><![CDATA[Inserting code that will be excluded depending on compiler arguments]]></description>
			<content:encoded><![CDATA[<p>Many times you look something up, do it once and think cool I&#8217;ll remember that as it&#8217;s simple.  Then 1 year later you&#8217;ve forgotten the syntax and you can&#8217;t find that help/blog page where you learned about it the first time.<br />
Well I needed to add in some debug code that would only be there for debugging, and the last thing I want to do when building a release version is to scan through the code to remove it. So the ideal way is to use a conditional compiler argument.</p>
<p>So in Flashbuilder, under the project properties and then the Flex compiler properties you&#8217;ll see something like this</p>
<div id="attachment_620" class="wp-caption aligncenter" style="width: 610px"><a href="http://kennethsutherland.com/wordpress1/wp-content/uploads/2011/01/compiler_args1.png"><img class="size-full wp-image-620" title="Compiler Arguments" src="http://kennethsutherland.com/wordpress1/wp-content/uploads/2011/01/compiler_args1.png" alt="Compiler Arguments" width="600" height="179" /></a><p class="wp-caption-text">Example for custom arguments</p></div>
<p>So if you had the following defined, -define=CONFIG::DEBUG,true -define+=CONFIG::SOMETHING_ELSE,false</p>
<p>Then in code you could do the following.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">    CONFIG<span style="color: #000066; font-weight: bold;">::</span>DEBUG
    <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">test</span> <span style="color: #000066; font-weight: bold;">:</span> <span style="color: #004993;">Boolean</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
    CONFIG<span style="color: #000066; font-weight: bold;">::</span>SOMETHING_ELSE
    <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> somethingElse<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">void</span>
    <span style="color: #000000;">&#123;</span>
&nbsp;
    <span style="color: #000000;">&#125;</span></pre></div></div>

<p>The variable and function code will only be included if the compiler argument is true. So in the above example if you called the function &#8216;somethingElse()&#8217; then this would generate a build error as somethingElse() doesn&#8217;t exist. Change the argument to true and it will build fine.</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-7396620608505330";
google_ad_slot = "1277482570";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://kennethsutherland.com/2011/01/07/additional-compiler-arguments-debug-only-code/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

