<?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 &#187; Flex</title>
	<atom:link href="http://kennethsutherland.com/category/general-flex-stuff/feed/" rel="self" type="application/rss+xml" />
	<link>http://kennethsutherland.com</link>
	<description>Flex with a hint of cool</description>
	<lastBuildDate>Fri, 30 Apr 2010 11:17:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Google, RSLs and indexing</title>
		<link>http://kennethsutherland.com/2009/06/26/google-rsls-and-indexing/</link>
		<comments>http://kennethsutherland.com/2009/06/26/google-rsls-and-indexing/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 15:55:09 +0000</pubDate>
		<dc:creator>Kenneth</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[indexing]]></category>
		<category><![CDATA[RSLs]]></category>
		<category><![CDATA[swf]]></category>

		<guid isPermaLink="false">http://kennethsutherland.com/?p=556</guid>
		<description><![CDATA[A while back I posted an article on Google giving errors with indexing SWF files that used the RSL framework feature to reduce the overall size of your SWF. It seemed to me very odd that you have Adobe trying to push the use of RSL&#8217;s as well as bumming up the great work that [...]]]></description>
			<content:encoded><![CDATA[<p>A while back I posted an article on Google giving errors with indexing SWF files that used the RSL framework feature to reduce the overall size of your SWF. It seemed to me very odd that you have Adobe trying to push the use of RSL&#8217;s as well as bumming up the great work that they&#8217;ve done with Google to index SWFs but not mentioning that fact that Google couldn&#8217;t index a SWF with an RSL. This lead people to see errors when they tried to find their app in a Google search.  See this for details <a title="Google and SWFs" href="http://kennethsutherland.com/2009/04/27/google-and-swfs/" target="_blank">http://kennethsutherland.com/2009/04/27/google-and-swfs/</a></p>
<p>Anyway good news, finally Google can index SWF files with external resources.  This news came out a few days back, but due to my blog needing fixed (it was breaking FF &#8211; wordpresses fault:( ) and other things going on blah blah&#8230;</p>
<p>Well here is the annoucement from Google - <a href="http://googlewebmastercentral.blogspot.com/2009/06/flash-indexing-with-external-resource.html" target="_blank">http://googlewebmastercentral.blogspot.com/2009/06/flash-indexing-with-external-resource.html</a> I have yet to try this out, but if it works as it say it does then great. another bonus for using Flex.</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/2009/06/26/google-rsls-and-indexing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Doom and gloom or a new beginning</title>
		<link>http://kennethsutherland.com/2009/06/23/doom-and-gloom-or-a-new-beginning/</link>
		<comments>http://kennethsutherland.com/2009/06/23/doom-and-gloom-or-a-new-beginning/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 14:52:33 +0000</pubDate>
		<dc:creator>Kenneth</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[contractor]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://kennethsutherland.com/?p=537</guid>
		<description><![CDATA[Redundancy… world shrinking economy… depression… company cutbacks… is this a bleak time or is it a time to make and face new challenges in the RIA world (particularly in the Flex and Actionscript areas)? Well after the unfortunate news that the company I work for are no longer wishing to partake in the RIA party [...]]]></description>
			<content:encoded><![CDATA[<p>Redundancy… world shrinking economy… depression… company cutbacks… is this a bleak time or is it a time to make and face new challenges in the RIA world (particularly in the Flex and Actionscript areas)?</p>
<p>Well after the unfortunate news that the company I work for are no longer wishing to partake in the RIA party that&#8217;s changing the way we look at and use the web/desktop and hence are making myself redundant. I&#8217;m looking at this as a great opportunity to expand my knowledge so that I can work with as many forward thinking companies as possible that deal with Flex/Actionscript/AIR or for that matter any RIA technology.<br />
Also I should now have more time to create and sell my own components, of which I had a cracking idea this morning (more on this later hopefully).</p>
<p>Hect I’ll event look at Silverlight or JavaFX <img src='http://kennethsutherland.com/wordpress1/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  if I get the time or the chance. So anyone out there fancy taking on a new contractor with 4 years+ experience in Flex as well as a bunch of other languages I’ve used along the way before I even heard of Flex.</p>
<p>Feel free to contact me at this address.<br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_Contact_1419960487"
			class="flashmovie"
			width="300"
			height="50">
	<param name="movie" value="/flex/contact/Contact.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/flex/contact/Contact.swf"
			name="fm_Contact_1419960487"
			width="300"
			height="50">
	<!--<![endif]-->
		
<p><a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>I’m going to continue to post hints and tips on anything I do as well as posting any new components so watch this space and feel free to contact me if you need any work done in the UK, remote working is always an option as well.</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/2009/06/23/doom-and-gloom-or-a-new-beginning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple tip #2 &#8211; random colours</title>
		<link>http://kennethsutherland.com/2009/06/12/simple-tip-2-random-colours/</link>
		<comments>http://kennethsutherland.com/2009/06/12/simple-tip-2-random-colours/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 08:12:23 +0000</pubDate>
		<dc:creator>Kenneth</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[colours]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[utility]]></category>

		<guid isPermaLink="false">http://kennethsutherland.com/?p=502</guid>
		<description><![CDATA[Their are so many times I&#8217;ve used a random colour in my apps (mainly for testing) that I thought I&#8217;d add this way of using a getter method with actionscript to simplify the process. First of if you haven&#8217;t got one already, create a uiltily class so features that you use regulary across projects (you [...]]]></description>
			<content:encoded><![CDATA[<p>Their are so many times I&#8217;ve used a random colour in my apps (mainly for testing) that I thought I&#8217;d add this way of using a getter method with actionscript to simplify the process.</p>
<p>First of if you haven&#8217;t got one already, create a uiltily class so features that you use regulary across projects (you could turn this file into a SWC and reference that in you various projects &#8211; now that I think about it I explain this as simple tip #3 <img src='http://kennethsutherland.com/wordpress1/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )</p>
<p>So inside your utility class place the following code</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">public</span> static <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">get</span> randomColour<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">uint</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">return</span> <span style="color: #004993;">Math</span>.<span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #004993;">uint</span>.<span style="color: #004993;">MAX_VALUE</span>;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Then lets just say you require a random colour for anything just call Utility.randomColour, no brackets, no = signs.  Because you&#8217;ve set the function as a getter using the function name will be enough.  This method also means that you don&#8217;t need to remember the max/min values for a colour.  The uint min and max values are the same as the the min/max values for colours.</p>
<p>e.g.</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Canvas</span> backgroundColor=<span style="color: #ff0000;">&quot;{Utility.randomColour}&quot;</span></span>
<span style="color: #000000;">   width=<span style="color: #ff0000;">&quot;600&quot;</span></span>
<span style="color: #000000;">   height=<span style="color: #ff0000;">&quot;600&quot;</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>Utility is the name of the class that holds my utility functions.</p>
<table width="100%">
<tr>
<td>
<p style="text-align: left;">
<a title="Simple tip #1" href="http://kennethsutherland.com/2009/05/22/simple-tip-1-custom-events/" target="_self">Previous Tip<br />
</a>
</p>
</td>
<td>
<p style="text-align: right;">
<a title="Simple tip #3" href="http://kennethsutherland.com/2009/06/12/simple-tip-3-utility-swc-library-project/" target="_self">Next Tip<br />
</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/2009/06/12/simple-tip-2-random-colours/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple tip #3 &#8211; Utility SWC (library project)</title>
		<link>http://kennethsutherland.com/2009/06/12/simple-tip-3-utility-swc-library-project/</link>
		<comments>http://kennethsutherland.com/2009/06/12/simple-tip-3-utility-swc-library-project/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 08:12:08 +0000</pubDate>
		<dc:creator>Kenneth</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[flex builder]]></category>
		<category><![CDATA[swc]]></category>
		<category><![CDATA[utility file]]></category>

		<guid isPermaLink="false">http://kennethsutherland.com/?p=509</guid>
		<description><![CDATA[Do you frequently use simple actionscript functions in more than one project. Perhaps you&#8217;ve got a function to do tracking, parse strings to dates, or return a random colour etc. I&#8217;m sure most folk will have struggled to think of what project they last used a generic function ABC in as they could do with [...]]]></description>
			<content:encoded><![CDATA[<p>Do you frequently use simple actionscript functions in more than one project. Perhaps you&#8217;ve got a function to do tracking, parse strings to dates, or return a random colour etc.</p>
<p>I&#8217;m sure most folk will have struggled to think of what project they last used a generic function ABC in as they could do with using it for project XYZ and would rather spend 30 mins searching for said function rather than rewrite it.</p>
<p>Well as explained below is a way to stop this from happening and hopefully save you a heap of time.</p>
<ul>
<li>
<h6>Step 1</h6>
<p> &#8211; Create a library project.</li>
<li>So using flexbuilder, go to File-&gt;New-&gt;Flex Library Project.</li>
<li>This will create an empty library project.</li>
</ul>
<ul>
<li>
<h6>Step 2</h6>
<p> &#8211; add in your Utilty class to the library project.</li>
<li>To do this add/create a Utility actionscript file that contains your static functions. Save, and this should then automaticlaly create a SWC file inside the library bin folder. (If it hasn&#8217;t and the file added has no errors then check the project properties to make sure the newly added file is being included &#8211; see pic)</li>
</ul>
<p><img class="aligncenter" title="Library path for adding files to SWC" src="/images/utility (Custom).JPG" alt="" width="600" height="185" /></p>
<ul>
<li>
<h6>Step 3</h6>
<p> &#8211; add the reference of the newly created SWC file to any project you intend to use it in.</li>
<li>So go to your project you wish to use the SWC with, then select the projects properties and inside &#8216;Flex build path&#8217; select &#8216;Add SWC&#8217;.</li>
<li>Browse to the the previous library project and select the SWC from its bin folder.</li>
</ul>
<p><img class="aligncenter" title="Adding a SWC to you project" src="/images/addSWC (Custom).JPG" alt="" width="600" height="222" /></p>
<p>You are now done, any time you update the code in the library project, those changes will be reflected in any project that references the SWC file automatically.</p>
<table width="100%">
<tr>
<td>
<p style="text-align: left;">
<a title="Simple tip #2" href="http://kennethsutherland.com/2009/06/12/simple-tip-2-random-colours/" target="_self">Previous Tip<br />
</a>
</p>
</td>
<td>
<p style="text-align: right;">
</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/2009/06/12/simple-tip-3-utility-swc-library-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Show dual coloured highlight for a DG</title>
		<link>http://kennethsutherland.com/2009/06/11/show-dual-coloured-highlight-for-a-dg/</link>
		<comments>http://kennethsutherland.com/2009/06/11/show-dual-coloured-highlight-for-a-dg/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 15:02:48 +0000</pubDate>
		<dc:creator>Kenneth</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[advanceddatagrid]]></category>
		<category><![CDATA[datagrid]]></category>
		<category><![CDATA[drawHighlightIndicator]]></category>

		<guid isPermaLink="false">http://kennethsutherland.com/?p=491</guid>
		<description><![CDATA[If you have a datagrid that has different coloured columns, then why should you have to do with only using a single colour for the highlight. Below is a simple soloution using actionscript to solve this. First I should state that you need to use the AdvancedDataGrid even if you only need a normal DataGrid. [...]]]></description>
			<content:encoded><![CDATA[<p>If you have a datagrid that has different coloured columns, then why should you have to do with only using a single colour for the highlight.</p>
<p>Below is a simple soloution using actionscript to solve this.</p>
<p>First I should state that you need to use the AdvancedDataGrid even if you only need a normal DataGrid.  This is because the AdvancedDataGrid has a method called drawHighlightIndicator(&#8230;), which as you&#8217;d expect from the name draws the highlight.  Normally this is a single colour, but with a little overriding you&#8217;ll be able to change this.</p>
<p>Below is the main snippet of code from the extended AdvancedDataGrid.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">override <span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> drawHighlightIndicator<span style="color: #000000;">&#40;</span>  indicator<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Sprite</span>, <span style="color: #004993;">x</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span>, <span style="color: #004993;">y</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span>,
	<span style="color: #004993;">width</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span>, <span style="color: #004993;">height</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span>, <span style="color: #004993;">color</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span>,  itemRenderer<span style="color: #000000; font-weight: bold;">:</span>IListItemRenderer<span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #009900;">//The indicator is the highlight, so grab its graphics and clear them</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> g<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Graphics</span> = <span style="color: #004993;">Sprite</span><span style="color: #000000;">&#40;</span>indicator<span style="color: #000000;">&#41;</span>.<span style="color: #004993;">graphics</span>;
	g.<span style="color: #004993;">clear</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
	<span style="color: #6699cc; font-weight: bold;">var</span> xPos <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</span> = <span style="color: #000000; font-weight:bold;">0</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> yPos <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</span> = <span style="color: #000000; font-weight:bold;">0</span>;
	<span style="color: #009900;">//loop through the number of columns in the datagrid</span>
	<span style="color: #0033ff; font-weight: bold;">for</span><span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> i <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">uint</span> = <span style="color: #000000; font-weight:bold;">0</span>; i <span style="color: #000000; font-weight: bold;">&amp;</span>lt; <span style="color: #0033ff; font-weight: bold;">this</span>.columnCount; i<span style="color: #000000; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>
		<span style="color: #009900;">//get a random colour</span>
		g.<span style="color: #004993;">beginFill</span><span style="color: #000000;">&#40;</span>randColour<span style="color: #000000;">&#41;</span>;
		<span style="color: #009900;">//draw the rectanlge that fills the first column</span>
		g.<span style="color: #004993;">drawRect</span><span style="color: #000000;">&#40;</span>xPos, <span style="color: #004993;">y</span>, <span style="color: #0033ff; font-weight: bold;">this</span>.columns<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span>.<span style="color: #004993;">width</span>, <span style="color: #004993;">height</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #009900;">//update the starting X position so that it starts at the begin of the</span>
		<span style="color: #009900;">//next column</span>
		xPos = xPos <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #0033ff; font-weight: bold;">this</span>.columns<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span>.<span style="color: #004993;">width</span>;
	<span style="color: #000000;">&#125;</span>
	g.<span style="color: #004993;">endFill</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>using the above you could create a DataGrid like the below which has some left hand columns in light purple and the rest in white. Then on highlight that same light purple colour is used for the white cells and the existing light purple becomes a slightly darker purple.</p>
<p><img class="aligncenter" title="Twin DG colour example" src="/flex/june09/TwinHighlight/twinDGColour.JPG" alt="Twin DG colour example" width="389" height="175" /></p>
<p>Check out this <a title="Twin coloured DG highlight" href="http://www.kennethsutherland.com/flex/june09/TwinHighlight/demoTwinHighlight.html" target="_blank">link to see a very simple/colourful demo</a>. As ever right click app for full source code.</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/2009/06/11/show-dual-coloured-highlight-for-a-dg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex Collection search &#8211; live</title>
		<link>http://kennethsutherland.com/2009/06/09/flex-collection-search-live/</link>
		<comments>http://kennethsutherland.com/2009/06/09/flex-collection-search-live/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 13:43:22 +0000</pubDate>
		<dc:creator>Kenneth</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[custom search]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://kennethsutherland.com/?p=477</guid>
		<description><![CDATA[When I was setting up my blog, one of the first things I found out about was creating custom searches using Google. So I promptly set up a custom search that had a list of my favourite and most frequently visited flex sites and at the same time if those sites didn&#8217;t have the info [...]]]></description>
			<content:encoded><![CDATA[<p>When I was setting up my blog, one of the first things I found out about was creating custom searches using Google.  So I promptly set up a custom search that had a list of my favourite and most frequently visited flex sites and at the same time if those sites didn&#8217;t have the info I required any search that was directed to the &#8216;web&#8217; rather than the &#8216;flex collection&#8217; would be weighted to sites that had AS3, Flex, or Adobe related info.<br />
After a little bit more research I managed to create an OpenSearch plugin from the custom Google search, and after that turned it into a firefox plugin.  See the &#8216;how to&#8217; <a title="Create your own custom search" href="http://kennethsutherland.com/2009/05/11/a-z-custom-search-to-firefox-plugin/" target="_blank">here </a>on creating your own custom search and firefox plugin.</p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/11823"><img class="aligncenter" title="Flex Collection" src="/images/flexColl (Custom).JPG" alt="" width="600" height="258" /></a></p>
<h5>Live</h5>
<p>Well the folk at Mozilla (or whoever tests the plugins) have just changed its status to LIVE <img src='http://kennethsutherland.com/wordpress1/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  yeh.<br />
check it out <a title="Plugin" href="http://addons.mozilla.org/addon/11823" target="_blank">here http://addons.mozilla.org/addon/11823</a><br />
You can also check out the original post with a list of all the included sites <a title="Flex, Firefox plugin" href="http://kennethsutherland.com/2009/05/05/flex-firefox-plug-in-community/" target="_blank">here</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/2009/06/09/flex-collection-search-live/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash Builder &#8211; Webservices &#8211; SoTR</title>
		<link>http://kennethsutherland.com/2009/06/09/flash-builder-webservices-sotr/</link>
		<comments>http://kennethsutherland.com/2009/06/09/flash-builder-webservices-sotr/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 07:57:14 +0000</pubDate>
		<dc:creator>Kenneth</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[events]]></category>
		<category><![CDATA[flash builder]]></category>
		<category><![CDATA[flex 4]]></category>
		<category><![CDATA[sotr09]]></category>
		<category><![CDATA[WSDL]]></category>

		<guid isPermaLink="false">http://kennethsutherland.com/?p=456</guid>
		<description><![CDATA[Question: What has a hidden entrance, is dark, damp and a just bit fousty (for any non Scottish readers - definition ) and takes quite a while to warm up? Answer: SoTR09 Yes, the Scotch on the Rocks 09 event held in Edinburgh was in a building called &#8216;The Caves&#8217;.  Oddly enough for a venue [...]]]></description>
			<content:encoded><![CDATA[<h6>Question:</h6>
<p> What has a hidden entrance, is dark, damp and a just bit fousty (for any non Scottish readers -<a title="Scottish words" href="http://en.wiktionary.org/wiki/Transwiki:List_of_Scottish_slang_words#F" target="_blank"> definition</a> ) and takes quite a while to warm up?</p>
<h6>Answer: </h6>
<p>SoTR09 <img src='http://kennethsutherland.com/wordpress1/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Yes, the Scotch on the Rocks 09 event held in Edinburgh was in a building called &#8216;The Caves&#8217;.  Oddly enough for a venue there was no sign outside to say that you were in the right place and on Friday there was a reasonable amount of rain.  So inside the main venue area you could see the water slowly runnning down the walls and the occasional drip noise coming from the corridor. The heaters didn&#8217;t come on till half way through the day but the tea &amp; beers made up for that.</p>
<p>So what about the day, well I&#8217;m not a coldfusion guy, actually I&#8217;ve never touched a line of coldfusion.  But I didn&#8217;t go to learn or find out about coldfusion, I went to see if there was any tip bits about flex.  Serge was doing a talk on the new Flash builder and Flash catalyst, plus there was the another talk that involved both flex (lifecycle) and coldfusion.</p>
<p>It was nice to see Flash catalyst in action and during some of the talks they did this cool thing with webservices as if it was just something that was just known.  What was done was to import a WSDL (webservice) then once you see the list of methods available and while in design view, drag a method onto a datagrid and flash builder automaticly populated the datagrid with the returned result fields.</p>
<h5>Something cool, other than Catalyst</h5>
<p><span style="font-weight: normal; font-size: 13px;">Maybe this isn&#8217;t a cool thing to most <span>people</span>, nobody in the room seemed to notice, maybe <span>because </span>they were pretty much all coldfusion devs!?  But I thought that it was pretty neat. Should save a heap of time typing, plus just like you can with AMF you can now specify a return type for the WSDL.  Great new additions to Flash Builder. (In order to set up the datagrid automatically you need to specify the return type before dragging it onto the datagrid)</span></p>
<p>Best thing you could do would be to try yourself, download Flash Builder <a title="flash builder" href="http://labs.adobe.com/technologies/flashbuilder4/" target="_blank">here</a>, then create a new project, then find a WSDL that you wish to test something like this <a title="weather" href="http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl" target="_blank">weather WSDL</a>, choose the menu in Flashbuilder &#8216;Data&#8217; -&gt; &#8216;Connect to Webservice&#8217;. Follow the wizard then play around with the services.  Try things like setting the return type (create your own object), or right click one of the methods and &#8216;generate form&#8217;.  Very good <span>additions</span>.</p>
<p>If you&#8217;re into coldfusion then I&#8217;d definitely recommend SoTR. Last year (08) had more flex than this year (09), so if you&#8217;re also into flex then keep an eye on it. <a title="Scotch on the Rocks" href="http://www.scotchontherocks-themovie.com/" target="_blank">Scotch on the Rocks</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/2009/06/09/flash-builder-webservices-sotr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Where&#8217;s the VBox?</title>
		<link>http://kennethsutherland.com/2009/06/08/wheres-the-vbox/</link>
		<comments>http://kennethsutherland.com/2009/06/08/wheres-the-vbox/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 10:18:46 +0000</pubDate>
		<dc:creator>Kenneth</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[comparision]]></category>
		<category><![CDATA[flashbuilder]]></category>
		<category><![CDATA[flex 4]]></category>
		<category><![CDATA[gumbo]]></category>

		<guid isPermaLink="false">http://kennethsutherland.com/?p=459</guid>
		<description><![CDATA[I resisted installing gumbo until it reached public beta, and having just done so started up a project only to find that using the auto complete VBox amongst others seemed to have disappeared.  Although using the VBox tag worked in exactly the same way as previously. This made me a tad curious, was this a [...]]]></description>
			<content:encoded><![CDATA[<p><span>I resisted installing gumbo until it reached public beta, and having just done so started up a project only to find that using the auto complete VBox amongst others seemed to have disappeared.  Although using the VBox tag worked in exactly the same way as previously.</span></p>
<p><span>This made me a tad curious, was this a bug with the beta, I doubted that as that would have been a major issue.  So i figured it must have been for a reason, and it was.  A very good reason it turned out!</span></p>
<p><span>Due to the large number of new component classes and the different namespaces, Flash Builder will now only show the recommended components when using auto complete (unless you press Ctrl + Space, then you cycle through various options such as &#8216;show all&#8217;).  This I like. Great idea and a great way to get those folk set in their ways to find out more about the new classes.</span></p>
<p>So what is recommended in place of the old VBox?  This took a little while of searching Google, but I&#8217;ve found this article in the Adobe Dev Connection, <a title="New and old components" href="http://www.adobe.com/devnet/flex/articles/flex3and4_differences_04.html" target="_blank"> http://www.adobe.com/devnet/flex/articles/flex3and4_differences_04.html</a>.  This lists the old versus new and shows that the VBox is now replaced by the VGroup.</p>
<p><span>So there you go, should you not find the class in the auto complete help to start with, press Ctrl + Space then check out the above link to find out what you should really be using.</span></p>
<p style="text-align: center;"><span><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>
<br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://kennethsutherland.com/2009/06/08/wheres-the-vbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FormItem, adding an icon</title>
		<link>http://kennethsutherland.com/2009/05/27/formitem-adding-an-icon/</link>
		<comments>http://kennethsutherland.com/2009/05/27/formitem-adding-an-icon/#comments</comments>
		<pubDate>Wed, 27 May 2009 13:07:13 +0000</pubDate>
		<dc:creator>Kenneth</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[extend]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[formItem]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[override]]></category>

		<guid isPermaLink="false">http://kennethsutherland.com/?p=425</guid>
		<description><![CDATA[Adding an icon to a form item is (yet another) one of those really annoying things in flex. I&#8217;m sure its something that loads of people wish to do but you can&#8217;t. Well just to see if I could, I set about and extended the FormItem class so that I could add an image/icon. After [...]]]></description>
			<content:encoded><![CDATA[<p>Adding an icon to a form item is (yet another) one of those really annoying things in flex.  I&#8217;m sure its something that loads of people wish to do but you can&#8217;t.</p>
<p>Well just to see if I could, I set about and extended the FormItem class so that I could add an image/icon.</p>
<p>After a quick look at the source code of the FormItem you can see that it only has two children. One, the label and two, the indicator.  So if you do wish to add anything else you&#8217;re going to have to extend the FormItem.</p>
<p>Thankfully the FormItem is based on the Container which makes adding anything fairly straight forward. I prefer to do any extending in actionscript but you could do the below in MXML with a bit of actionscript code at the same time.</p>
<p>There are 3 steps you need to make.</p>
<ol>
<li>Override the createChildren method</li>
<li>Set the image source</li>
<li>Override the label</li>
</ol>
<h4>Override the createChildren</h4>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">protected</span> override <span style="color: #339966; font-weight: bold;">function</span> createChildren<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; 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;">super</span>.createChildren<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
    <span style="color: #009900;">//you could move the image creation into a seperate function when and if the imagesource has been set</span>
	<span style="color: #009900;">//but for this example I've kept it simple.</span>
	<span style="color: #0033ff; font-weight: bold;">this</span>.image = <span style="color: #0033ff; font-weight: bold;">new</span> Image<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
	image.<span style="color: #004993;">width</span> = <span style="color: #000000; font-weight:bold;">16</span>;
	image.<span style="color: #004993;">height</span> = <span style="color: #000000; font-weight:bold;">16</span>;
	<span style="color: #009900;">//again I've hardcoded these values for simplicity</span>
	<span style="color: #009900;">//You could if you wanted to create a versitile custom component load these values in from a CSS file</span>
	image.<span style="color: #004993;">setStyle</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">'verticalCenter'</span>, <span style="color: #000000; font-weight:bold;">0</span> <span style="color: #000000;">&#41;</span>;
	image.<span style="color: #004993;">setStyle</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">'left'</span>, <span style="color: #000000; font-weight:bold;">5</span> <span style="color: #000000;">&#41;</span>;
	image.<span style="color: #004993;">source</span> = _imageSource;
	<span style="color: #0033ff; font-weight: bold;">this</span>.rawChildren.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>image<span style="color: #000000;">&#41;</span>;
	<span style="color: #009900;">//bind the string property to the image source property.</span>
	BindingUtils.bindProperty<span style="color: #000000;">&#40;</span>image, <span style="color: #990000;">'source'</span>, <span style="color: #0033ff; font-weight: bold;">this</span>, <span style="color: #990000;">'imageSource'</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>from the above code you&#8217;ll see that all I&#8217;ve done is create an image, set its various properties and add it to the form.</p>
<p>most of this could and probably should be moved to a separate function (but for this demo I haven&#8217;t) so that you only add the image if it is actually required.  Also the style settings should come from a CSS file but for simplicity of the demo I haven&#8217;t done this.</p>
<h4>Set the image source</h4>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _imageSource <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">String</span> = <span style="color: #990000;">''</span>;
&nbsp;
<span style="color: #000000;">&#91;</span>Bindable<span style="color: #000000;">&#93;</span>
<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">get</span> imageSource<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">String</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">return</span> _imageSource;
<span style="color: #000000;">&#125;</span> 
&nbsp;
<span style="color: #009900;">//Sets the imageSource and I've added a number of spaces at the start to offset the </span>
<span style="color: #009900;">//width of the image.</span>
<span style="color: #009900;">//The overall form width will be calculated from the width of the label (this is done inside the FormItem) </span>
<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">set</span> imageSource<span style="color: #000000;">&#40;</span>str <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">String</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
  _imageSource = str;
  <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>_imageSource.<span style="color: #004993;">length</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><span style="color: #009900;">//setting the label (not using _label) will resize the form/formItems</span>
  <span style="color: #009900;">//add spaces to the trimed version to make sure you don't end up with 100's of spaces at the start.</span>
	label = <span style="color: #990000;">&quot;   &quot;</span> <span style="color: #000000; font-weight: bold;">+</span> StringUtil.trim<span style="color: #000000;">&#40;</span>_label<span style="color: #000000;">&#41;</span>;
  <span style="color: #000000;">&#125;</span> <span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #000000;">&#123;</span>
	label = StringUtil.trim<span style="color: #000000;">&#40;</span>_label<span style="color: #000000;">&#41;</span>;
  <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>In the above code you can see that I set the variable _imageSource (which bound to the images source &#8211; see first snippet of code).  If the source is not &#8220;&#8221; then I add spaces to the label, make sure you set label and not _label.  This makes sure that the label width gets recalcualted.</p>
<h4>Override the label</h4>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #009900;">//Sets the label.</span>
<span style="color: #009900;">//If the imageSource has been set already then this will add spaces to the label</span>
<span style="color: #0033ff; font-weight: bold;">public</span> override <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">set</span> label<span style="color: #000000;">&#40;</span>str <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">String</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
  _label = str;
  <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>_imageSource.<span style="color: #004993;">length</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>
	_label = <span style="color: #990000;">&quot;   &quot;</span> <span style="color: #000000; font-weight: bold;">+</span> str;
  <span style="color: #000000;">&#125;</span> <span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #000000;">&#123;</span>
	_label = StringUtil.trim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#41;</span>;
  <span style="color: #000000;">&#125;</span>
  <span style="color: #009900;">// call the super last, this will also force the remeausing of the formItem and Form</span>
  <span style="color: #0033ff; font-weight: bold;">super</span>.label = _label;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>The above code is very similar to the setter that set the imageSource but this time it sets _label then makes sure that the super function gets the new label.</p>
<p>Check out the <a title="FormItem demo" href="http://kennethsutherland.com/flex/formItem/FormItemDemo.html" target="_blank">simple demo here</a>. (Right click for source)</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/2009/05/27/formitem-adding-an-icon/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Exploding pie charts, part 2</title>
		<link>http://kennethsutherland.com/2009/05/27/exploding-pie-charts-part-2/</link>
		<comments>http://kennethsutherland.com/2009/05/27/exploding-pie-charts-part-2/#comments</comments>
		<pubDate>Wed, 27 May 2009 09:32:02 +0000</pubDate>
		<dc:creator>Kenneth</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[charts]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[effects]]></category>
		<category><![CDATA[explode]]></category>
		<category><![CDATA[legend]]></category>
		<category><![CDATA[Pie charts]]></category>
		<category><![CDATA[pie series]]></category>
		<category><![CDATA[SeriesInterpolate]]></category>

		<guid isPermaLink="false">http://kennethsutherland.com/?p=404</guid>
		<description><![CDATA[In one of my first blogs I demoed a pie chart that made each of the wedges from the pie explode out the way when its item in the legend was rolled over by the mouse. The pie chart also had a nice effect when it was shown in that it filled up in a [...]]]></description>
			<content:encoded><![CDATA[<p>In one of my <a title="Exploding Pie Charts" href="http://kennethsutherland.com/2009/04/02/exploding-pie-charts/" target="_self">first blogs</a> I demoed a pie chart that made each of the wedges from the pie explode out the way when its item in the legend was rolled over by the mouse.<br />
The pie chart also had a nice effect when it was shown in that it filled up in a circular manor.</p>
<p>You can check out the <a title="Exploding Pie Charts" href="/flex/pies/main.html" target="_blank">app here</a>.</p>
<p>After a comment/question from the previous post asking about something I didn&#8217;t explain, I thought that it deservered its own post rather than just an edit of the original.</p>
<p>So the question was how do you get the circular effect, and how do you do &#8216;(&#8230; %)&#8217; in the legend?</p>
<h5>The effect</h5>
<p>Firstly set up the effect</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;mx:SeriesInterpolate</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;doughnut&quot;</span> <span style="color: #000066;">duration</span>=<span style="color: #ff0000;">&quot;1000&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>Then whatever ID you have given your pie series you&#8217;d do the following (I called my one &#8216;seriesOne&#8217;)</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">seriesOne.<span style="color: #004993;">setStyle</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">'showDataEffect'</span>, doughnut<span style="color: #000000;">&#41;</span>;</pre></div></div>

<p>(I did this set up in the script block on creation complete or show + I nulled the effect/DP&#8217;s on hide so that you get the full effect each time) </p>
<p>If you wish to get the full opening of the circle effect then the data must be empty to start with as the effect just changes between the current and the new values.</p>
<p>The second part of the question was to do with the labels on the legend.  This one is all to do with how you set up your dataprovider for the pie chart.</p>
<h5>The label</h5>
<p>I start of with loading in the data from an XML file (if you use some HTTP tool you should be able to see the data).  It goes something like the following</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;chartOne<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;chartName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>blah<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/chartName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;data<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;section<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>item 1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>37.55<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/section<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;section<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>item 2<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>13.33<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/section<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>               
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/data<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/chartOne<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>As you&#8217;ll see from the data there is no &#8216;%&#8217;. So what I do is when I load the data I construct an object VO (value object).</p>
<p>This VO contains the name, item and a label.  The label is just the name + &#8216;(&#8216; + value +&#8217;%)&#8217;.  Then the arrayCollection I use for the dataprovider is just a collection of these object VO&#8217;s.</p>
<p>Essentially my VO is this,</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> obj <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Object</span> =<span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Object</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
obj.<span style="color: #004993;">name</span> = <span style="color: #990000;">'item 1'</span>;
obj.<span style="color: #004993;">value</span> = <span style="color: #000000; font-weight:bold;">37.55</span>;
obj.label = obj.<span style="color: #004993;">name</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #990000;">'('</span> <span style="color: #000000; font-weight: bold;">+</span> obj.<span style="color: #004993;">value</span> <span style="color: #000000; font-weight: bold;">+</span><span style="color: #990000;">'%)'</span>;</pre></div></div>

<p>The legend looks at the data for the pie chart and sees the label property and uses that as it is.</p>
<p>This may make you ask about the datatip for the actual pie chart as it doesn&#8217;t contain the brackets. Well for that I had to implement a <i>dataTipFunction</i>.</p>
<p>This function took the form,</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> returnToolTip<span style="color: #000000;">&#40;</span>hitData<span style="color: #000000; font-weight: bold;">:</span>HitData<span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> <span style="color: #000000;">&#123;</span>
    <span style="color: #0033ff; font-weight: bold;">return</span> hitData.item.<span style="color: #004993;">name</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #990000;">' '</span> <span style="color: #000000; font-weight: bold;">+</span>hitData.item.<span style="color: #004993;">value</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #990000;">'%'</span>;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>and you just can set this in the MXML of the pie chart.</p>
<p>Well hopefully thats explained in a reasonable way, I&#8217;d love to open the entire source for this but without reworking it (commercial reasons) I can&#8217;t.</p>
<p>Check out <a title="Exploding Pie Charts" href="http://kennethsutherland.com/2009/04/02/exploding-pie-charts/" target="_self">part one of the blog here</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/2009/05/27/exploding-pie-charts-part-2/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
