<?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>zoltanb.co.uk</title>
	<atom:link href="http://zoltanb.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://zoltanb.co.uk</link>
	<description>Flex and Meow</description>
	<lastBuildDate>Sun, 12 Feb 2012 22:21:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>LaunchpadCleaner  2 &#8211; The Missing Mac OS X Lion Launchpad Manager!</title>
		<link>http://zoltanb.co.uk/launchpadcleaner/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=launchpadcleaner</link>
		<comments>http://zoltanb.co.uk/launchpadcleaner/#comments</comments>
		<pubDate>Wed, 27 Jul 2011 14:23:52 +0000</pubDate>
		<dc:creator>zoltanb</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[Launchpad]]></category>
		<category><![CDATA[os x lion]]></category>

		<guid isPermaLink="false">http://zoltanb.co.uk/?p=518</guid>
		<description><![CDATA[<p>LaunchpadCleaner is a simple and effective tool for keeping your Mac OS X Launchpad organised.</p> <p></p> <p>News:</p> <p>You can download the latest version of LaunchpadCleaner from here:</p> <a title="Official Launchpad Cleaner website!" href="http://launchpadcleaner.com/" target="_blank">http://launchpadcleaner.com/</a> <p><a href="http://launchpadcleaner.com"></a></p> <p>LaunchpadCleaner lets you remove/rename/backup/restore All your Launchpad icons, you can even transfer your Launchpad layout to another mac!</p> <p>For [...]]]></description>
			<content:encoded><![CDATA[<p>LaunchpadCleaner is a simple and effective tool for keeping your Mac OS X Launchpad organised.</p>
<p><span id="more-518"></span></p>
<blockquote><p><strong>News:</strong></p>
<p>You can download the latest version of LaunchpadCleaner from here:</p>
<h2 style="text-align: center;"><a title="Official Launchpad Cleaner website!" href="http://launchpadcleaner.com/" target="_blank">http://launchpadcleaner.com/</a></h2>
<p><a href="http://launchpadcleaner.com"><img class="alignnone" title="Official Launchpad Cleaner website" src="http://launchpadcleaner.com/ad/launchpadsite.png" alt="launchpadsite LaunchpadCleaner  2   The Missing Mac OS X Lion Launchpad Manager!" width="500" height="210" /></a></p></blockquote>
<p>LaunchpadCleaner lets you remove/rename/backup/restore All your Launchpad icons, you can even transfer your Launchpad layout to another mac!</p>
<p>For Downloads or Help &amp; Support please go to the new <a title="Launchpad Cleaner Help &amp; Support" href="http://launchpadcleaner.com/support">LaunchpadCleaner Support page</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://zoltanb.co.uk/launchpadcleaner/feed/</wfw:commentRss>
		<slash:comments>235</slash:comments>
		</item>
		<item>
		<title>How to install Jenkins on Scientific Linux for Flex Development</title>
		<link>http://zoltanb.co.uk/how-to-install-jenkins-on-scientific-linux-for-flex-development/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-install-jenkins-on-scientific-linux-for-flex-development</link>
		<comments>http://zoltanb.co.uk/how-to-install-jenkins-on-scientific-linux-for-flex-development/#comments</comments>
		<pubDate>Mon, 25 Jul 2011 15:28:24 +0000</pubDate>
		<dc:creator>zoltanb</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[jenkins]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[scien]]></category>

		<guid isPermaLink="false">http://zoltanb.co.uk/?p=493</guid>
		<description><![CDATA[<p>Jenkins is an open source continuous integration server. Here&#8217;s how to set it up on Linux for managinf as3/flex applications/modules/libraries:</p> <p></p> Installation Install Jenkins: Install Flash Player for running Unit tests:<br /> in your sdk folder find: /runtimes/player/10/lnx/flashplayer.tar.gz<br /> Extract the contents and add flashplayer to the path.<br /> Try sudo -u jenkins flashplayer on [...]]]></description>
			<content:encoded><![CDATA[<p>Jenkins is an open source continuous integration server. Here&#8217;s how to set it up on Linux for managinf as3/flex applications/modules/libraries:</p>
<p><span id="more-493"></span></p>
<h2>Installation</h2>
<ol>
<li>Install Jenkins:<br />
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="bash">
<pre class="de1"><span class="kw2">sudo</span> <span class="kw2">wget</span> <span class="re5">-O</span> <span class="sy0">/</span>etc<span class="sy0">/</span>yum.repos.d<span class="sy0">/</span>jenkins.repo http:<span class="sy0">//</span>pkg.jenkins-ci.org<span class="sy0">/</span>redhat<span class="sy0">/</span>jenkins.repo
<span class="kw2">sudo</span> rpm <span class="re5">--import</span> http:<span class="sy0">//</span>pkg.jenkins-ci.org<span class="sy0">/</span>redhat<span class="sy0">/</span>jenkins-ci.org.key
yum <span class="kw2">install</span> jenkins </pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
sudo rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key
yum install jenkins </pre>
</div>
</div>
</li>
<li>Install Flash Player for running Unit tests:<br />
in your sdk folder find: <em>/runtimes/player/10/lnx/flashplayer.tar.gz</em><br />
Extract the contents and add <em>flashplayer</em> to the path.<br />
Try <em>sudo -u jenkins flashplayer </em>on the commandline to verify that it&#8217;s working correctly.<br />
You might need to chmod/chown it.</li>
<li>Install XVNC Plugin In Jenkins:<br />
<em>Go to Jenkins&gt;Manage Jenkins&gt;Mange Plugins&gt;Available</em><br />
Find XVNC, select it and click install.</li>
<li>Install a vnc server on the box:<br />
<code class="bwp-syntax-inline">yum <span style="color: #660033;">-y</span> <span style="color: #c20cb9; font-weight: bold;">install</span> tigervnc-server </code></li>
<li>Set up the vnc password for Jenkins:<br />
<code class="bwp-syntax-inline"><span style="color: #c20cb9; font-weight: bold;">sudo</span> vncpasswd <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>jenkins<span style="color: #000000; font-weight: bold;">/</span>.vnc<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">passwd</span><br />
Password:<br />
Verify: </code></li>
</ol>
<h2>Start/Stop Jenkins</h2>
<ul>
<li><tt><code class="bwp-syntax-inline"><span style="color: #c20cb9; font-weight: bold;">sudo</span> service jenkins start</code></tt></li>
<li><tt><tt><code class="bwp-syntax-inline"><span style="color: #c20cb9; font-weight: bold;">sudo</span> service jenkins stop</code></tt></tt></li>
<li><tt><tt><tt><code class="bwp-syntax-inline"><span style="color: #c20cb9; font-weight: bold;">sudo</span> service jenkins restart</code></tt></tt></tt></li>
</ul>
<h2>Default Jenkins Config</h2>
<p>If you installed jenkins using the steps above, you should have the following default configuration:</p>
<ul>
<li>The default Jenkins installation folder is:<br />
<code class="bwp-syntax-inline"><span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>jenkins</code></li>
<li>If you reboot your box, Jenkins will be automatically started as a daemon. To change/remove this, edit: <code class="bwp-syntax-inline"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>jenkins</code></li>
<li>A <em>jenkins</em> user is created.</li>
<li>The default jenkins url is: http://localhost:8080</li>
</ul>
<h2>Troubleshooting</h2>
<ul>
<li><strong>Error:</strong><br />
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="bash">
<pre class="de1">Caused by: java.io.IOException: Cannot run program <span class="st0">&quot;xvfb-run&quot;</span>: java.io.IOException: <span class="re2">error</span>=<span class="nu0">2</span>, No such <span class="kw2">file</span> or directory</pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">Caused by: java.io.IOException: Cannot run program "xvfb-run": java.io.IOException: error=2, No such file or directory</pre>
</div>
</div>
<p><strong>Solution:</strong><br />
<code class="bwp-syntax-inline">yum <span style="color: #c20cb9; font-weight: bold;">install</span> Xvfb</code><br />
or use xvnc&#8230;</li>
<li><strong>Error:</strong><br />
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="bash">
<pre class="de1">Failed to launch Flash Player. Probably java was not able to <span class="kw2">find</span> flashplayer.</pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">Failed to launch Flash Player. Probably java was not able to find flashplayer.</pre>
</div>
</div>
<p><strong><br />
Solution:</strong><br />
1. in your sdk folder find: <em>/runtimes/player/10/lnx/flashplayer.tar.gz</em><br />
Extract the contents and add <em>flashplayer</em> to the path.</li>
<li><strong>Error:</strong><br />
<code class="bwp-syntax-inline"><span class="br0">&#91;</span>WARNING<span class="br0">&#93;</span> <span class="br0">&#91;</span>LAUNCHER<span class="br0">&#93;</span> Using xvfb-run to launch headless tests <span class="br0">&#91;</span>ERROR<span class="br0">&#93;</span> Failed to delete Xvfb locking files, does the current user has access? java.io.IOException: File <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>.X11-unix<span style="color: #000000; font-weight: bold;">/</span>X0 unable to be deleted.</code><strong><br />
Solution:</strong><br />
change the ownership to the jenkins user:<br />
<code class="bwp-syntax-inline"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> jenkins:jenkins <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>.X11-unix</code></li>
<li><strong>Error:</strong><br />
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="bash">
<pre class="de1"><span class="br0">&#91;</span>ERROR<span class="br0">&#93;</span> Unexpected <span class="kw3">return</span> code <span class="nu0">127</span><span class="sy0">/</span>var<span class="sy0">/</span>lib<span class="sy0">/</span>jenkins<span class="sy0">/</span>workspace<span class="sy0">/</span>...</pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">[ERROR] Unexpected return code 127/var/lib/jenkins/workspace/...</pre>
</div>
</div>
<p><strong>Solution:</strong><br />
Xvfb is not configured correctly.<br />
I found it easier to install XVNC Plugin In Jenkins:<br />
<em>Go to Jenkins&gt;Manage Jenkins&gt;Mange Plugins&gt;Available</em><br />
Find XVNC and install it.<br />
2. Install a vnc server:<br />
<code class="bwp-syntax-inline">yum <span style="color: #660033;">-y</span> <span style="color: #c20cb9; font-weight: bold;">install</span> tigervnc-server </code></li>
<li><strong>Error:</strong><br />
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="bash">
<pre class="de1">$ vncserver :<span class="nu0">15</span> You will require a password to access your desktops. getpassword error: Invalid argument Password:ERROR: Failed to parse POMs java.io.IOException: Failed to run <span class="st_h">'vncserver :15'</span> <span class="br0">&#40;</span><span class="kw3">exit</span> code <span class="nu0">1</span><span class="br0">&#41;</span>, blacklisting display <span class="co0">#15; consider checking the &quot;Clean up before start&quot; option</span></pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">$ vncserver :15 You will require a password to access your desktops. getpassword error: Invalid argument Password:ERROR: Failed to parse POMs java.io.IOException: Failed to run 'vncserver :15' (exit code 1), blacklisting display #15; consider checking the "Clean up before start" option</pre>
</div>
</div>
<p><strong>Solution:</strong><br />
use <em>vncpasswd</em> to create a default password:<br />
<code class="bwp-syntax-inline">vncpasswd <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>jenkins<span style="color: #000000; font-weight: bold;">/</span>.vnc<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">passwd</span></code></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://zoltanb.co.uk/how-to-install-jenkins-on-scientific-linux-for-flex-development/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to calculate the Perceived Brightness of a colour</title>
		<link>http://zoltanb.co.uk/how-to-calculate-the-perceived-brightness-of-a-colour/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-calculate-the-perceived-brightness-of-a-colour</link>
		<comments>http://zoltanb.co.uk/how-to-calculate-the-perceived-brightness-of-a-colour/#comments</comments>
		<pubDate>Sun, 24 Jul 2011 20:22:18 +0000</pubDate>
		<dc:creator>zoltanb</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[colours]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[flex skinning]]></category>

		<guid isPermaLink="false">http://zoltanb.co.uk/?p=469</guid>
		<description><![CDATA[<p>How would you determine programmatically  whether Black text or White text is more readable on a colour background?</p> <p></p> <p>Here are a few algorithms to calculate the brightness of a color: (see the interactive demo at the bottom of this page)</p> 1. Arithmetic Mean: Formula: <p><a href="http://zoltanb.co.uk/wp-content/uploads/2011/07/Screen-Shot-2011-07-24-at-20.15.09.png"></a></p> <p>AS3 Code:</p> <p>It was a very simple and [...]]]></description>
			<content:encoded><![CDATA[<p>How would you determine programmatically  whether Black text or White text is more readable on a colour background?</p>
<p><span id="more-469"></span></p>
<p>Here are a few algorithms to calculate the brightness of a color: (see the interactive demo at the bottom of this page)</p>
<h2>1. Arithmetic Mean:</h2>
<h4>Formula:<img src="http://www.texify.com/img/%5CLARGE%5C%21f%5E%5Cprime%28x%29%5C%20%3D%20%5Cfrac%7Br%20%2B%20g%20%2B%20b%7D3.gif" alt="%5CLARGE%5C%21f%5E%5Cprime%28x%29%5C%20%3D%20%5Cfrac%7Br%20%2B%20g%20%2B%20b%7D3 How to calculate the Perceived Brightness of a colour" align="middle" border="0" title="How to calculate the Perceived Brightness of a colour" /></h4>
<p><a href="http://zoltanb.co.uk/wp-content/uploads/2011/07/Screen-Shot-2011-07-24-at-20.15.09.png"><img class="size-full wp-image-471 alignnone" title="Screen Shot 2011-07-24 at 20.15.09" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/Screen-Shot-2011-07-24-at-20.15.09.png" alt="Screen Shot 2011 07 24 at 20.15.09 How to calculate the Perceived Brightness of a colour" width="517" height="207" /></a></p>
<p><strong>AS3 Code:</strong></p>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="actionscript3">
<pre class="de1"><span class="kw1">public</span> static <span class="kw3">function</span> arithmeticMean<span class="br0">&#40;</span>hex<span class="sy0">:</span><span class="kw5">uint</span><span class="br0">&#41;</span><span class="sy0">:</span><span class="kw5">Number</span>
<span class="br0">&#123;</span>
<span class="kw2">var</span> rgb<span class="sy0">:</span><span class="kw5">Array</span> = ColorUtils<span class="sy0">.</span>hex2rgb<span class="br0">&#40;</span>hex<span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw1">return</span> <span class="br0">&#40;</span>rgb<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span> <span class="sy0">+</span> rgb<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span> <span class="sy0">+</span> rgb<span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">/</span><span class="nu0">3</span><span class="sy0">;</span>
<span class="br0">&#125;</span></pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">public static function arithmeticMean(hex:uint):Number
{
var rgb:Array = ColorUtils.hex2rgb(hex);
return (rgb[0] + rgb[1] + rgb[2])/3;
}</pre>
</div>
</div>
<p>It was a very simple and effective algorithm. Unfortunately it failed between the green and turquoise region:<br />
<a href="http://zoltanb.co.uk/wp-content/uploads/2011/07/Screen-Shot-2011-07-24-at-20.17.39.png"><img class="alignleft size-full wp-image-472" title="Screen Shot 2011-07-24 at 20.17.39" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/Screen-Shot-2011-07-24-at-20.17.39.png" alt="Screen Shot 2011 07 24 at 20.17.39 How to calculate the Perceived Brightness of a colour" width="515" height="47" /></a></p>
<p>&nbsp;</p>
<h2>Geometric Mean:</h2>
<h4>Formula:<img src="http://www.texify.com/img/%5CLARGE%5C%21f%5E%5Cprime%28x%29%5C%20%3D%20%5Csqrt%5Bn%5D%7Br%20%20g%20%20b%7D.gif" alt="%5CLARGE%5C%21f%5E%5Cprime%28x%29%5C%20%3D%20%5Csqrt%5Bn%5D%7Br%20%20g%20%20b%7D How to calculate the Perceived Brightness of a colour" align="middle" border="0" title="How to calculate the Perceived Brightness of a colour" /></h4>
<p><img class="alignnone size-full wp-image-474" title="Screen Shot 2011-07-24 at 20.30.50" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/Screen-Shot-2011-07-24-at-20.30.50.png" alt="Screen Shot 2011 07 24 at 20.30.50 How to calculate the Perceived Brightness of a colour" width="515" height="208" /></p>
<p><strong>AS3 Code:</strong></p>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="actionscript3">
<pre class="de1"><span class="kw1">public</span> static <span class="kw3">function</span> geometricMean<span class="br0">&#40;</span>hex<span class="sy0">:</span><span class="kw5">uint</span><span class="br0">&#41;</span><span class="sy0">:</span><span class="kw5">Number</span>
<span class="br0">&#123;</span>
<span class="kw2">var</span> rgb<span class="sy0">:</span><span class="kw5">Array</span> = ColorUtils<span class="sy0">.</span>hex2rgb<span class="br0">&#40;</span>hex<span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw1">return</span> <span class="kw5">Math</span><span class="sy0">.</span><span class="kw7">pow</span><span class="br0">&#40;</span>rgb<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span> <span class="sy0">*</span> rgb<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span> <span class="sy0">*</span> rgb<span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span><span class="sy0">,</span><span class="nu0">1</span><span class="sy0">/</span><span class="nu0">3</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span></pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">public static function geometricMean(hex:uint):Number
{
var rgb:Array = ColorUtils.hex2rgb(hex);
return Math.pow(rgb[0] * rgb[1] * rgb[2],1/3);
}</pre>
</div>
</div>
<p>Ok, the green is a lot better, but now the brightness of the yellow is wrong:</p>
<p><img class="alignnone size-full wp-image-476" title="Screen Shot 2011-07-24 at 20.31.59" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/Screen-Shot-2011-07-24-at-20.31.59.png" alt="Screen Shot 2011 07 24 at 20.31.59 How to calculate the Perceived Brightness of a colour" width="514" height="46" /></p>
<h2>Quadratic Mean:</h2>
<h4>Formula:<img src="http://www.texify.com/img/%5CLARGE%5C%21f%5E%5Cprime%28x%29%5C%20%3D%20%5Csqrt%7B%5Cfrac%7Br%5E2%20g%5E2%20b%5E2%7D%7B3%7D%7D.gif" alt="%5CLARGE%5C%21f%5E%5Cprime%28x%29%5C%20%3D%20%5Csqrt%7B%5Cfrac%7Br%5E2%20g%5E2%20b%5E2%7D%7B3%7D%7D How to calculate the Perceived Brightness of a colour" align="middle" border="0" title="How to calculate the Perceived Brightness of a colour" /></h4>
<p><img class="alignnone size-full wp-image-477" title="Screen Shot 2011-07-24 at 20.35.00" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/Screen-Shot-2011-07-24-at-20.35.00.png" alt="Screen Shot 2011 07 24 at 20.35.00 How to calculate the Perceived Brightness of a colour" width="514" height="255" /></p>
<p><strong>AS3 Code:</strong></p>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="actionscript3">
<pre class="de1"><span class="kw1">public</span> static <span class="kw3">function</span> quadraticMean<span class="br0">&#40;</span>hex<span class="sy0">:</span><span class="kw5">uint</span><span class="br0">&#41;</span><span class="sy0">:</span><span class="kw5">Number</span>
<span class="br0">&#123;</span>
<span class="kw2">var</span> rgb<span class="sy0">:</span><span class="kw5">Array</span> = ColorUtils<span class="sy0">.</span>hex2rgb<span class="br0">&#40;</span>hex<span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw1">return</span> <span class="kw5">Math</span><span class="sy0">.</span><span class="kw7">pow</span><span class="br0">&#40;</span> <span class="br0">&#40;</span>rgb<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span><span class="sy0">*</span>rgb<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span> <span class="sy0">+</span> rgb<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span><span class="sy0">*</span>rgb<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span> <span class="sy0">+</span> rgb<span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span><span class="sy0">*</span>rgb<span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">/</span><span class="nu0">3</span> <span class="sy0">,</span><span class="nu0">1</span><span class="sy0">/</span><span class="nu0">2</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span></pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">public static function quadraticMean(hex:uint):Number
{
var rgb:Array = ColorUtils.hex2rgb(hex);
return Math.pow( (rgb[0]*rgb[0] + rgb[1]*rgb[1] + rgb[2]*rgb[2])/3 ,1/2);
}</pre>
</div>
</div>
<p>Works really well for all dark colours. Fails on purple.</p>
<h2>HSV Value (Brightest Component):</h2>
<h4>Formula: <img src="http://www.texify.com/img/%5CLARGE%5C%21f%5E%5Cprime%28x%29%5C%20%3D%20%5Cmax_%7Br%2C%20g%2C%20b%7D.gif" alt="%5CLARGE%5C%21f%5E%5Cprime%28x%29%5C%20%3D%20%5Cmax %7Br%2C%20g%2C%20b%7D How to calculate the Perceived Brightness of a colour" align="middle" border="0" title="How to calculate the Perceived Brightness of a colour" /></h4>
<h2><img class="alignnone size-full wp-image-479" title="Screen Shot 2011-07-24 at 20.43.26" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/Screen-Shot-2011-07-24-at-20.43.26.png" alt="Screen Shot 2011 07 24 at 20.43.26 How to calculate the Perceived Brightness of a colour" width="516" height="208" /></h2>
<p><strong>AS3 Code:</strong></p>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="actionscript3">
<pre class="de1"><span class="kw1">public</span> static <span class="kw3">function</span> valueFromHSV<span class="br0">&#40;</span>hex<span class="sy0">:</span><span class="kw5">uint</span><span class="br0">&#41;</span><span class="sy0">:</span><span class="kw5">Number</span>
<span class="br0">&#123;</span>
<span class="kw2">var</span> hsv<span class="sy0">:</span><span class="kw5">Array</span> = ColorUtils<span class="sy0">.</span>hex2hsv<span class="br0">&#40;</span>hex<span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw1">return</span> hsv<span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span><span class="sy0">*</span><span class="nu0">255</span><span class="sy0">;</span>
<span class="br0">&#125;</span></pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">public static function valueFromHSV(hex:uint):Number
{
var hsv:Array = ColorUtils.hex2hsv(hex);
return hsv[2]*255;
}</pre>
</div>
</div>
<p>Dark colours are ok, Fails when the r, g or b value is close to 0&#215;99</p>
<h2>Darkest Component:</h2>
<h4>Formula: <img src="http://www.texify.com/img/%5CLARGE%5C%21f%5E%5Cprime%28x%29%5C%20%3D%20%5Cmin_%7Br%2C%20g%2C%20b%7D.gif" alt="%5CLARGE%5C%21f%5E%5Cprime%28x%29%5C%20%3D%20%5Cmin %7Br%2C%20g%2C%20b%7D How to calculate the Perceived Brightness of a colour" align="middle" border="0" title="How to calculate the Perceived Brightness of a colour" /></h4>
<p><img class="alignnone size-full wp-image-480" title="Screen Shot 2011-07-24 at 20.52.08" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/Screen-Shot-2011-07-24-at-20.52.08.png" alt="Screen Shot 2011 07 24 at 20.52.08 How to calculate the Perceived Brightness of a colour" width="516" height="255" /></p>
<p><strong>AS3 Code:</strong></p>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="actionscript3">
<pre class="de1"><span class="kw1">public</span> static <span class="kw3">function</span> darkestComponent<span class="br0">&#40;</span>hex<span class="sy0">:</span><span class="kw5">uint</span><span class="br0">&#41;</span><span class="sy0">:</span><span class="kw5">Number</span>
<span class="br0">&#123;</span>
<span class="kw2">var</span> rgb<span class="sy0">:</span><span class="kw5">Array</span> = ColorUtils<span class="sy0">.</span>hex2rgb<span class="br0">&#40;</span>hex<span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw1">return</span> <span class="kw5">Math</span><span class="sy0">.</span><span class="kw7">min</span><span class="br0">&#40;</span>rgb<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span><span class="sy0">,</span> rgb<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span><span class="sy0">,</span> rgb<span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span></pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">public static function darkestComponent(hex:uint):Number
{
var rgb:Array = ColorUtils.hex2rgb(hex);
return Math.min(rgb[0], rgb[1], rgb[2]);
}</pre>
</div>
</div>
<p>Only the very bright colours work fine with this algorithm.</p>
<h2>3D distance in RGB space:</h2>
<h4>Formula: <img src="http://www.texify.com/img/%5CLARGE%5C%21f%5E%5Cprime%28x%29%5C%20%3D%20%5Csqrt%7Br%5E2%20%2B%20g%5E2%20%2B%20b%5E2%7D.gif" alt="%5CLARGE%5C%21f%5E%5Cprime%28x%29%5C%20%3D%20%5Csqrt%7Br%5E2%20%2B%20g%5E2%20%2B%20b%5E2%7D How to calculate the Perceived Brightness of a colour" align="middle" border="0" title="How to calculate the Perceived Brightness of a colour" /></h4>
<p><img class="alignnone size-full wp-image-481" title="Screen Shot 2011-07-24 at 20.53.51" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/Screen-Shot-2011-07-24-at-20.53.51.png" alt="Screen Shot 2011 07 24 at 20.53.51 How to calculate the Perceived Brightness of a colour" width="516" height="254" /></p>
<p><strong>AS3 Code:</strong></p>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="actionscript3">
<pre class="de1"><span class="kw1">public</span> static <span class="kw3">function</span> distanceIn3D<span class="br0">&#40;</span>hex<span class="sy0">:</span><span class="kw5">uint</span><span class="br0">&#41;</span><span class="sy0">:</span><span class="kw5">Number</span>
<span class="br0">&#123;</span>
<span class="kw2">var</span> rgb<span class="sy0">:</span><span class="kw5">Array</span> = ColorUtils<span class="sy0">.</span>hex2rgb<span class="br0">&#40;</span>hex<span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw1">return</span> <span class="kw5">Math</span><span class="sy0">.</span><span class="kw7">sqrt</span><span class="br0">&#40;</span> <span class="br0">&#40;</span>rgb<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span><span class="sy0">*</span>rgb<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span> <span class="sy0">+</span> rgb<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span><span class="sy0">*</span>rgb<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span> <span class="sy0">+</span> rgb<span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span><span class="sy0">*</span>rgb<span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span></pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">public static function distanceIn3D(hex:uint):Number
{
var rgb:Array = ColorUtils.hex2rgb(hex);
return Math.sqrt( (rgb[0]*rgb[0] + rgb[1]*rgb[1] + rgb[2]*rgb[2]));
}</pre>
</div>
</div>
<p>Worse than using the V component of the HSV representation.</p>
<h2>Lightness From HSL:</h2>
<p><img class="alignnone size-full wp-image-482" title="Screen Shot 2011-07-24 at 20.57.08" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/Screen-Shot-2011-07-24-at-20.57.08.png" alt="Screen Shot 2011 07 24 at 20.57.08 How to calculate the Perceived Brightness of a colour" width="517" height="253" /></p>
<p><strong>AS3 Code:</strong></p>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="actionscript3">
<pre class="de1"><span class="kw1">public</span> static <span class="kw3">function</span> lightnessFromHSL<span class="br0">&#40;</span>hex<span class="sy0">:</span><span class="kw5">uint</span><span class="br0">&#41;</span><span class="sy0">:</span><span class="kw5">Number</span>
<span class="br0">&#123;</span>
<span class="kw2">var</span> hsl<span class="sy0">:</span><span class="kw5">Array</span> = ColorUtils<span class="sy0">.</span>hex2hsl<span class="br0">&#40;</span>hex<span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw1">return</span> hsl<span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span><span class="sy0">*</span><span class="nu0">255</span><span class="sy0">;</span>
<span class="br0">&#125;</span></pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">public static function lightnessFromHSL(hex:uint):Number
{
var hsl:Array = ColorUtils.hex2hsl(hex);
return hsl[2]*255;
}</pre>
</div>
</div>
<p>The best unweighted formula. Fails on yellow around 0xeeee00.</p>
<h1>Weighted Algorithms</h1>
<p>Natural formulas don&#8217;t take into consideration that the human eye perceives some of the primary colours darker than others.</p>
<p>Eg pure green(0xff0000) is perceived brighter than pure blue(0x00ff00).<br />
According to the W3C consortium, this biased perception can be modelled with the following weights:</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;"><div class="actionscript3"><pre class="de1">r <span class="sy0">*</span>= <span class="sy0">.</span>299
g <span class="sy0">*</span>= <span class="sy0">.</span>587
<span class="kw7">b</span> <span class="sy0">*</span>= <span class="sy0">.</span>111</pre></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">r *= .299
g *= .587
b *= .111</pre></div></div>

<h2>Weighted W3C Formula:</h2>
<h4>Formula: <img src="http://www.texify.com/img/%5CLARGE%5C%21f%5E%5Cprime%28x%29%5C%20%3D%20%5Cfrac%7Br%2A299%20%2B%20g%2A587%20%2Bg%2A117%7D%7B1000%7D.gif" alt="%5CLARGE%5C%21f%5E%5Cprime%28x%29%5C%20%3D%20%5Cfrac%7Br%2A299%20%2B%20g%2A587%20%2Bg%2A117%7D%7B1000%7D How to calculate the Perceived Brightness of a colour" align="middle" border="0" title="How to calculate the Perceived Brightness of a colour" /></h4>
<h2><img class="alignnone size-full wp-image-483" title="Screen Shot 2011-07-24 at 21.11.02" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/Screen-Shot-2011-07-24-at-21.11.02.png" alt="Screen Shot 2011 07 24 at 21.11.02 How to calculate the Perceived Brightness of a colour" width="516" height="254" /></h2>
<p><strong>AS3 Code:</strong></p>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="actionscript3">
<pre class="de1"><span class="kw1">public</span> static <span class="kw3">function</span> weightedW3C<span class="br0">&#40;</span>hex<span class="sy0">:</span><span class="kw5">uint</span><span class="br0">&#41;</span><span class="sy0">:</span><span class="kw5">Number</span>
<span class="br0">&#123;</span>
<span class="kw2">var</span> rgb<span class="sy0">:</span><span class="kw5">Array</span> = ColorUtils<span class="sy0">.</span>hex2rgb<span class="br0">&#40;</span>hex<span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw1">return</span> <span class="br0">&#40;</span><span class="br0">&#40;</span>rgb<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span> <span class="sy0">*</span> <span class="nu0">299</span><span class="br0">&#41;</span> <span class="sy0">+</span> <span class="br0">&#40;</span>rgb<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span> <span class="sy0">*</span> <span class="nu0">587</span><span class="br0">&#41;</span> <span class="sy0">+</span> <span class="br0">&#40;</span>rgb<span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span> <span class="sy0">*</span> <span class="nu0">114</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="sy0">/</span> <span class="nu0">1000</span><span class="sy0">;</span>
<span class="br0">&#125;</span></pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">public static function weightedW3C(hex:uint):Number
{
var rgb:Array = ColorUtils.hex2rgb(hex);
return ((rgb[0] * 299) + (rgb[1] * 587) + (rgb[2] * 114)) / 1000;
}</pre>
</div>
</div>
<p>Very good algorithm, works really well. Source: <a href="http://www.w3.org/TR/AERT#color-contrast" target="_blank">http://www.w3.org/TR/AERT#color-contrast</a></p>
<h2>Weighted Distance in 3D RGB Space:</h2>
<h4>Formula:</h4>
<h2><img src="http://www.texify.com/img/%5CLARGE%5C%21f%5E%5Cprime%28x%29%5C%20%3D%20%5Csqrt%7B%20r%5E2%20%2A%200.241%20%2B%20g%5E2%20%2A%200.691%20%2B%20b%5E2%20%2A%200.068%7D.gif" alt="%5CLARGE%5C%21f%5E%5Cprime%28x%29%5C%20%3D%20%5Csqrt%7B%20r%5E2%20%2A%200.241%20%2B%20g%5E2%20%2A%200.691%20%2B%20b%5E2%20%2A%200.068%7D How to calculate the Perceived Brightness of a colour" align="middle" border="0" title="How to calculate the Perceived Brightness of a colour" /></h2>
<p><img class="alignnone size-full wp-image-484" title="Screen Shot 2011-07-24 at 21.17.13" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/Screen-Shot-2011-07-24-at-21.17.13.png" alt="Screen Shot 2011 07 24 at 21.17.13 How to calculate the Perceived Brightness of a colour" width="517" height="255" /></p>
<p><strong>AS3 Code:</strong></p>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="actionscript3">
<pre class="de1"><span class="kw1">public</span> static <span class="kw3">function</span> weightedDistanceIn3D<span class="br0">&#40;</span>hex<span class="sy0">:</span><span class="kw5">uint</span><span class="br0">&#41;</span><span class="sy0">:</span><span class="kw5">Number</span>
<span class="br0">&#123;</span>
<span class="kw2">var</span> rgb<span class="sy0">:</span><span class="kw5">Array</span> = ColorUtils<span class="sy0">.</span>hex2rgb<span class="br0">&#40;</span>hex<span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw1">return</span> <span class="kw5">Math</span><span class="sy0">.</span><span class="kw7">sqrt</span><span class="br0">&#40;</span>rgb<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span> <span class="sy0">*</span> rgb<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span> <span class="sy0">*</span> <span class="sy0">.</span>241 <span class="sy0">+</span> rgb<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span> <span class="sy0">*</span> rgb<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span> <span class="sy0">*</span> <span class="sy0">.</span>691 <span class="sy0">+</span> rgb<span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span> <span class="sy0">*</span> rgb<span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span> <span class="sy0">*</span> <span class="sy0">.</span>068<span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span></pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">public static function weightedDistanceIn3D(hex:uint):Number
{
var rgb:Array = ColorUtils.hex2rgb(hex);
return Math.sqrt(rgb[0] * rgb[0] * .241 + rgb[1] * rgb[1] * .691 + rgb[2] * rgb[2] * .068);
}</pre>
</div>
</div>
<p>An improved version of the W3C fomula.<br />
Source: http://www.nbdtech.com/Blog/archive/2008/04/27/Calculating-the-Perceived-Brightness-of-a-Color.aspx</p>
<h1>Flex demo for testing Perceived Brightness:</h1>
<p>click on the colour picker to test the brightness of a colour:</p>

<!-- Iframe plugin v.2.1 (wordpress.org/extend/plugins/iframe/) -->
<iframe width="100%" height="400" src="/external/PerceivedBrightness" scrolling="no" class="iframe-class" frameborder="0"></iframe>
<h1>Downloads</h1>
<a class="downloadlink" href="http://zoltanb.co.uk/wp-content/plugins/download-monitor/download.php?id=2" title=" downloaded 13 times" >ColorUtils (13)</a>
]]></content:encoded>
			<wfw:commentRss>http://zoltanb.co.uk/how-to-calculate-the-perceived-brightness-of-a-colour/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Mac os Lion Compatibility for developers</title>
		<link>http://zoltanb.co.uk/mac-os-lion-compatibility-for-flex-developers/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mac-os-lion-compatibility-for-flex-developers</link>
		<comments>http://zoltanb.co.uk/mac-os-lion-compatibility-for-flex-developers/#comments</comments>
		<pubDate>Sat, 23 Jul 2011 14:27:23 +0000</pubDate>
		<dc:creator>zoltanb</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[os x lion]]></category>

		<guid isPermaLink="false">http://zoltanb.co.uk/?p=451</guid>
		<description><![CDATA[<p>I&#8217;ve just migrated to Mac OS X 10.7 (Lion). Here&#8217;s what worked and what failed on OS X Lion:</p> <p></p> Flash Builder 4.5:<br /> Java runtime needed to be installed.<br /> Opened a project, compiled it, ran the unit tests, everything worked fine. No major issues found<br /> Update:<br /> Yesterday my right click context [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just migrated to Mac OS X 10.7 (Lion). Here&#8217;s what worked and what failed on OS X Lion:</p>
<p><span id="more-451"></span></p>
<ol>
<li><strong><img title="tick_circle" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/tick_circle.png" alt="tick circle Mac os Lion Compatibility for developers" width="16" height="16" /> Flash Builder 4.5:</strong><br />
Java runtime needed to be installed.<br />
Opened a project, compiled it, ran the unit tests, everything worked fine. No major issues found<br />
<strong>Update:</strong><br />
Yesterday my right click context menu stopped working(ie. it didn&#8217;t appear) in the package explorer after cmd-tabbing back and forth between VMWare and FB 4.5.<br />
After closing and reopening package explorer it started working again&#8230;.</li>
<li><strong><img title="tick_circle" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/tick_circle.png" alt="tick circle Mac os Lion Compatibility for developers" width="16" height="16" /> FDT 4:</strong><br />
Opened a project, compiled it. No issues found</li>
<li><strong><img title="tick_circle" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/tick_circle.png" alt="tick circle Mac os Lion Compatibility for developers" width="16" height="16" /> STS &#8211; SpringSource Toolkit</strong><br />
Opened a Groovy project and compiled it. No issues found</li>
<li><strong><img title="tick_circle" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/tick_circle.png" alt="tick circle Mac os Lion Compatibility for developers" width="16" height="16" /> IntelliJ IDEA 10</strong><br />
Opened a Maven project, updated dependencies, compiled it. No issues found</li>
<li><strong><img title="tick_circle" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/tick_circle.png" alt="tick circle Mac os Lion Compatibility for developers" width="16" height="16" /> Forklift</strong> &#8211; No issues found</li>
<li><strong><img title="tick_circle" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/tick_circle.png" alt="tick circle Mac os Lion Compatibility for developers" width="16" height="16" /> Adobe Fireworks CS5</strong><br />
Opened a project, exported the image slices. No issues found</li>
<li><strong><strong><img title="cross_circle" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/cross_circle.png" alt="cross circle Mac os Lion Compatibility for developers" width="16" height="16" /> </strong>VMWare Fusion<br />
</strong>Started a Fedora Core Image. No issues found<strong><br />
Update: </strong>After restarting the computer, I got the following error message in VMWare:</p>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="actionscript3">
<pre class="de1">VMWare Fusion cannot <span class="kw7">connect</span> to the virtual machine<span class="sy0">.</span>
Make sure you have rights to run the program and to access all directories it uses and rights to access all directories <span class="kw1">for</span> temporary files<span class="sy0">.</span></pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">VMWare Fusion cannot connect to the virtual machine.
Make sure you have rights to run the program and to access all directories it uses and rights to access all directories for temporary files.</pre>
</div>
</div>
<p><strong><a href="http://zoltanb.co.uk/wp-content/uploads/2011/07/Screen-Shot-2011-07-26-at-11.27.08.png"><img class="alignnone size-full wp-image-511" title="Screen Shot 2011-07-26 at 11.27.08" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/Screen-Shot-2011-07-26-at-11.27.08.png" alt="Screen Shot 2011 07 26 at 11.27.08 Mac os Lion Compatibility for developers" width="423" height="151" /></a><br />
</strong>After some googling I found 2 possible solutions:<br />
1. chmod all vmware image files to 777 &#8211; it didn&#8217;t work for me<br />
2. reinstall VMWare &#8211; which introduced a new error:</p>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="actionscript3">
<pre class="de1">VMware Fusion can’t be installed on <span class="kw1">this</span> computer<span class="sy0">.</span>
Sorry<span class="sy0">,</span> VMware Fusion can only be installed on Macs <span class="kw1">with</span> Intel processors<span class="sy0">.</span></pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">VMware Fusion can’t be installed on this computer.
Sorry, VMware Fusion can only be installed on Macs with Intel processors.</pre>
</div>
</div>
<p><a href="http://zoltanb.co.uk/wp-content/uploads/2011/07/Screen-Shot-2011-07-26-at-12.09.38.png"><img class="alignnone size-full wp-image-512" title="Screen Shot 2011-07-26 at 12.09.38" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/Screen-Shot-2011-07-26-at-12.09.38.png" alt="Screen Shot 2011 07 26 at 12.09.38 Mac os Lion Compatibility for developers" width="412" height="133" /></a><strong>Solution</strong>: Uninstall, download VMware Fusion 3.1.3, install</li>
<li><strong><img title="tick_circle" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/tick_circle.png" alt="tick circle Mac os Lion Compatibility for developers" width="16" height="16" /> Launchbar </strong>- No issues found</li>
<li><strong><img title="cross_circle" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/cross_circle.png" alt="cross circle Mac os Lion Compatibility for developers" width="16" height="16" /> Visor</strong><br />
Didn&#8217;t work at all. I updated to TotalTerminal, it worked fine.</li>
<li><strong><img title="tick_circle" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/tick_circle.png" alt="tick circle Mac os Lion Compatibility for developers" width="16" height="16" /> TotalTerminal</strong> &#8211; No issues found</li>
<li><strong><img title="tick_circle" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/tick_circle.png" alt="tick circle Mac os Lion Compatibility for developers" width="16" height="16" /> TextWrangler</strong> &#8211; No issues found</li>
<li><strong><img title="tick_circle" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/tick_circle.png" alt="tick circle Mac os Lion Compatibility for developers" width="16" height="16" /> Maya 2009 &#8211; </strong>No issues found<br />
Opened a project, navigated around, did a quick software render and a mental ray render, everything worked fine.</li>
<li><strong><img title="cross_circle" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/cross_circle.png" alt="cross circle Mac os Lion Compatibility for developers" width="16" height="16" /> <strong><img title="tick_circle" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/tick_circle.png" alt="tick circle Mac os Lion Compatibility for developers" width="16" height="16" /> </strong>Little Snitch &#8211; </strong>Stopped working without any warning.<br />
Upgraded to the latest version and it started working again.</li>
</ol>
<p>Pretty good start.</p>
<p>Now I have ugly springy elastic scrollbars and Launchpad that turns my macbook pro into a 15&#8243; iPhone&#8230;.</p>
<p>Oh, and I can resize windows from all 4 corners&#8230;. which is really handy because the maximise button still doesn&#8217;t maximise anything&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://zoltanb.co.uk/mac-os-lion-compatibility-for-flex-developers/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Flex Performance Tuning &#8211; superfast list component</title>
		<link>http://zoltanb.co.uk/flex-performance-tuning-superfast-list-component/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=flex-performance-tuning-superfast-list-component</link>
		<comments>http://zoltanb.co.uk/flex-performance-tuning-superfast-list-component/#comments</comments>
		<pubDate>Fri, 15 Jul 2011 16:22:17 +0000</pubDate>
		<dc:creator>zoltanb</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://zoltanb.co.uk/?p=407</guid>
		<description><![CDATA[<p>The spark List component is designed to render large datasets into a small viewport. However, when you need to display hundreds of itemrenderers at the same time, the performance can drop drastically.</p> <p></p> <p>Here&#8217;s a basic List component that displays &#62;300 small itemRenderers in the viewport. The dataProvider has 10,000 items. Try dragging the scrollbar [...]]]></description>
			<content:encoded><![CDATA[<p>The spark List component is designed to render large datasets into a small viewport. However, when you need to display hundreds of itemrenderers at the same time, the performance can drop drastically.</p>
<p><span id="more-407"></span></p>
<p>Here&#8217;s a basic List component that displays &gt;300 small itemRenderers in the viewport. The dataProvider has 10,000 items. Try dragging the scrollbar thumb.<br />
(See the optimised version at the bottom of this page).<br />

<!-- Iframe plugin v.2.1 (wordpress.org/extend/plugins/iframe/) -->
<iframe width="100%" height="430" src="/external/ItemRendererTest" scrolling="no" class="iframe-class" frameborder="0"></iframe><br />
(right click to view source.)</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;"><div class="actionscript3"><pre class="de1"><span class="sy0">&lt;</span>s<span class="sy0">:</span>List <span class="kw7">width</span>=<span class="st0">&quot;100%&quot;</span> <span class="kw7">height</span>=<span class="st0">&quot;100%&quot;</span> <span class="kw7">top</span>=<span class="st0">&quot;10&quot;</span>
            dataProvider=<span class="st0">&quot;{colours}&quot;</span> <span class="sy0">&gt;</span>
        <span class="sy0">&lt;</span>s<span class="sy0">:</span>layout<span class="sy0">&gt;</span>
            <span class="sy0">&lt;</span>s<span class="sy0">:</span>TileLayout horizontalGap=<span class="st0">&quot;1&quot;</span> verticalGap=<span class="st0">&quot;1&quot;</span> <span class="sy0">/&gt;</span>
        <span class="sy0">&lt;/</span>s<span class="sy0">:</span>layout<span class="sy0">&gt;</span>
        <span class="sy0">&lt;</span>s<span class="sy0">:</span>itemRenderer<span class="sy0">&gt;</span>
            <span class="sy0">&lt;</span>fx<span class="sy0">:</span>Component<span class="sy0">&gt;</span>
                <span class="sy0">&lt;</span>s<span class="sy0">:</span>ItemRenderer <span class="kw7">width</span>=<span class="st0">&quot;20&quot;</span> <span class="kw7">height</span>=<span class="st0">&quot;6&quot;</span> <span class="sy0">&gt;</span>
                    <span class="sy0">&lt;</span>s<span class="sy0">:</span>Rect <span class="kw7">width</span>=<span class="st0">&quot;100%&quot;</span> <span class="kw7">height</span>=<span class="st0">&quot;100%&quot;</span><span class="sy0">&gt;</span>
                        <span class="sy0">&lt;</span>s<span class="sy0">:</span>fill<span class="sy0">&gt;</span>
                            <span class="sy0">&lt;</span>s<span class="sy0">:</span>SolidColor <span class="kw7">color</span>=<span class="st0">&quot;{data}&quot;</span> <span class="sy0">/&gt;</span>
                        <span class="sy0">&lt;/</span>s<span class="sy0">:</span>fill<span class="sy0">&gt;</span>
                    <span class="sy0">&lt;/</span>s<span class="sy0">:</span>Rect<span class="sy0">&gt;</span>
                <span class="sy0">&lt;/</span>s<span class="sy0">:</span>ItemRenderer<span class="sy0">&gt;</span>
            <span class="sy0">&lt;/</span>fx<span class="sy0">:</span>Component<span class="sy0">&gt;</span>
        <span class="sy0">&lt;/</span>s<span class="sy0">:</span>itemRenderer<span class="sy0">&gt;</span>
    <span class="sy0">&lt;/</span>s<span class="sy0">:</span>List<span class="sy0">&gt;</span></pre></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">&lt;s:List width="100%" height="100%" top="10"
            dataProvider="{colours}" &gt;
        &lt;s:layout&gt;
            &lt;s:TileLayout horizontalGap="1" verticalGap="1" /&gt;
        &lt;/s:layout&gt;
        &lt;s:itemRenderer&gt;
            &lt;fx:Component&gt;
                &lt;s:ItemRenderer width="20" height="6" &gt;
                    &lt;s:Rect width="100%" height="100%"&gt;
                        &lt;s:fill&gt;
                            &lt;s:SolidColor color="{data}" /&gt;
                        &lt;/s:fill&gt;
                    &lt;/s:Rect&gt;
                &lt;/s:ItemRenderer&gt;
            &lt;/fx:Component&gt;
        &lt;/s:itemRenderer&gt;
    &lt;/s:List&gt;</pre></div></div>

<p>The Spark List component is designed to use a separate itemrenderer for each item in the viewport, then &#8211; if possible &#8211; re-use them when you are scrolling up or down. So, in the example above, instead of creating 10,000 itemrenderers, the spark list component only creates ~300:<br />
<a href="http://zoltanb.co.uk/wp-content/uploads/2011/07/itemrenderer.png"><img class="alignnone size-full wp-image-419" title="itemrenderer" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/itemrenderer.png" alt="itemrenderer Flex Performance Tuning   superfast list component" width="239" height="245" /></a></p>
<p>This approach works perfectly if you only have a few itemrenderers on stage, ie. the itemrenderers are big and/or the viewport is small.</p>
<p>If you have a big viewport with small itemrenderers, even if the itemRenderers are lightweight, you will end up with too many displayobjects on the stage and the invalidation phase will be painfully slow.</p>
<h3>A Different Approach</h3>
<p>When you want to display hundreds/thousands of items on screen simultaneously, consider using a canvas(eg. a BitmapData object), where you can &#8220;paint&#8221; your items:</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;"><div class="actionscript3"><pre class="de1">    <span class="sy0">&lt;</span>s<span class="sy0">:</span>BitmapImage id=<span class="st0">&quot;bmp&quot;</span> <span class="kw7">width</span>=<span class="st0">&quot;100%&quot;</span> <span class="kw7">height</span>=<span class="st0">&quot;100%&quot;</span>
                   <span class="kw7">source</span>=<span class="st0">&quot;{itemRenderer.canvas}&quot;</span>  <span class="sy0">&gt;</span>
    <span class="sy0">&lt;/</span>s<span class="sy0">:</span>BitmapImage<span class="sy0">&gt;</span>
&nbsp;
    <span class="sy0">&lt;</span>s<span class="sy0">:</span>VScrollBar id=<span class="st0">&quot;scr&quot;</span> skinClass=<span class="st0">&quot;spark.skins.spark.VScrollBarSkin&quot;</span>
                  <span class="kw7">right</span>=<span class="st0">&quot;0&quot;</span> <span class="kw7">height</span>=<span class="st0">&quot;100%&quot;</span> <span class="sy0">&gt;</span>
        <span class="sy0">&lt;</span>s<span class="sy0">:</span>change<span class="sy0">&gt;</span>
            <span class="sy0">&lt;!</span><span class="br0">&#91;</span>CDATA<span class="br0">&#91;</span>
                invalidateDisplayList<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
            <span class="br0">&#93;</span><span class="br0">&#93;</span><span class="sy0">&gt;</span>
        <span class="sy0">&lt;/</span>s<span class="sy0">:</span>change<span class="sy0">&gt;</span>
    <span class="sy0">&lt;/</span>s<span class="sy0">:</span>VScrollBar<span class="sy0">&gt;</span></pre></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">    &lt;s:BitmapImage id="bmp" width="100%" height="100%"
                   source="{itemRenderer.canvas}"  &gt;
    &lt;/s:BitmapImage&gt;

    &lt;s:VScrollBar id="scr" skinClass="spark.skins.spark.VScrollBarSkin"
                  right="0" height="100%" &gt;
        &lt;s:change&gt;
            &lt;![CDATA[
                invalidateDisplayList();
            ]]&gt;
        &lt;/s:change&gt;
    &lt;/s:VScrollBar&gt;</pre></div></div>

<p><img class="alignnone size-full wp-image-422" title="itemrenderer2" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/itemrenderer2.png" alt="itemrenderer2 Flex Performance Tuning   superfast list component" width="309" height="234" /></p>
<p>When you scroll around, you can use

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;"><div class="actionscript3"><pre class="de1">bitmapdata<span class="sy0">.</span><span class="kw7">scroll</span><span class="br0">&#40;</span><span class="nu0">0</span><span class="sy0">,</span>scrollAmount<span class="br0">&#41;</span></pre></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">bitmapdata.scroll(0,scrollAmount)</pre></div></div>

<p>, so you only have to render the area you scrolled into:</p>
<p><img class="alignnone size-full wp-image-423" title="itemrenderer3" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/itemrenderer3.png" alt="itemrenderer3 Flex Performance Tuning   superfast list component" width="309" height="234" /></p>
<h3>Optimised example:</h3>
<p>The dataprovider is the same as the one in the previous example: 10,000 items, ~300 in the viewport. Try dragging the scrollbar thumb:<br />

<!-- Iframe plugin v.2.1 (wordpress.org/extend/plugins/iframe/) -->
<iframe width="100%" height="430" src="/external/BitmapItemRenderer" scrolling="no" class="iframe-class" frameborder="0"></iframe><br />
(right click to view source)</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;"><div class="actionscript3"><pre class="de1">    <span class="sy0">&lt;</span>local<span class="sy0">:</span>BitmapList <span class="kw7">width</span>=<span class="st0">&quot;100%&quot;</span> <span class="kw7">height</span>=<span class="st0">&quot;100%&quot;</span> <span class="kw7">top</span>=<span class="st0">&quot;10&quot;</span>
                      dataProvider=<span class="st0">&quot;{colours}&quot;</span> <span class="sy0">&gt;</span>
        <span class="sy0">&lt;</span>local<span class="sy0">:</span>itemRenderer<span class="sy0">&gt;</span>
            <span class="sy0">&lt;</span>local<span class="sy0">:</span>BitmapListItemRenderer <span class="kw7">width</span>=<span class="st0">&quot;20&quot;</span> <span class="kw7">height</span>=<span class="st0">&quot;6&quot;</span> <span class="sy0">/&gt;</span>
        <span class="sy0">&lt;/</span>local<span class="sy0">:</span>itemRenderer<span class="sy0">&gt;</span>
    <span class="sy0">&lt;/</span>local<span class="sy0">:</span>BitmapList<span class="sy0">&gt;</span></pre></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">    &lt;local:BitmapList width="100%" height="100%" top="10"
                      dataProvider="{colours}" &gt;
        &lt;local:itemRenderer&gt;
            &lt;local:BitmapListItemRenderer width="20" height="6" /&gt;
        &lt;/local:itemRenderer&gt;
    &lt;/local:BitmapList&gt;</pre></div></div>

<p>Here ALL items in the viewport are re-rendered on Change event. This can be further optimised by introducing bitmapdata.scroll and only rendering the area we are scrolling into.</p>
<p>Note: This example is just a quick mockup to demonstrate the performance improvement you can gain by replacing hundreds of itemRenderers by a single bitmap. Focus management and layout management are not implemented.</p>
]]></content:encoded>
			<wfw:commentRss>http://zoltanb.co.uk/flex-performance-tuning-superfast-list-component/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to pass in parameters to a Flex Air app at startup</title>
		<link>http://zoltanb.co.uk/how-to-pass-in-parameters-to-a-flex-air-app-at-startup/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-pass-in-parameters-to-a-flex-air-app-at-startup</link>
		<comments>http://zoltanb.co.uk/how-to-pass-in-parameters-to-a-flex-air-app-at-startup/#comments</comments>
		<pubDate>Sun, 03 Jul 2011 16:43:02 +0000</pubDate>
		<dc:creator>zoltanb</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://zoltanb.co.uk/?p=384</guid>
		<description><![CDATA[<p>Air applications ((extended)desktop, (extended)mobileDevice, (extended)TV ) can accept custom startup parameters.</p> <p>To retrieve passed in parameters in a web based pure AS3 applications, you need to use: </p> <p>In Flex applications:<br /> In AS3 Air applications you can retrieve the passed in params via an InvokeEvent listener:</p> <p>In Flex Air application you need to listen [...]]]></description>
			<content:encoded><![CDATA[<p>Air applications ((extended)desktop, (extended)mobileDevice, (extended)TV ) can accept custom startup parameters.</p>
<blockquote><p><span id="more-384"></span>To retrieve passed in parameters in a web based pure AS3 applications, you need to use:<br />
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="actionscript3">
<pre class="de1"><span class="kw5">LoaderInfo</span><span class="br0">&#40;</span><span class="kw1">this</span><span class="sy0">.</span><span class="kw7">root</span><span class="sy0">.</span><span class="kw7">loaderInfo</span><span class="br0">&#41;</span><span class="sy0">.</span><span class="kw7">parameters</span></pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">LoaderInfo(this.root.loaderInfo).parameters</pre>
</div>
</div>
<p>In Flex applications:<br />
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="actionscript3">
<pre class="de1">Application<span class="sy0">.</span>application<span class="sy0">.</span><span class="kw7">parameters</span></pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">Application.application.parameters</pre>
</div>
</div>
<p>In AS3 Air applications you can retrieve the passed in params via an InvokeEvent listener:</p>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="actionscript3">
<pre class="de1">NativeApplication<span class="sy0">.</span>nativeApplication<span class="sy0">.</span><span class="kw7">addEventListener</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="br0">&#40;</span>InvokeEvent<span class="sy0">.</span>INVOKE<span class="sy0">,</span> onInvokeEvent<span class="br0">&#41;</span><span class="sy0">;</span></pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">NativeApplication.nativeApplication.addEventListener
               (InvokeEvent.INVOKE, onInvokeEvent);</pre>
</div>
</div>
</blockquote>
<p>In Flex Air application you need to listen to InvokeEvent.INVOKE</p>
<h2>Flex 4 Parameter example</h2>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="actionscript3">
<pre class="de1"><span class="sy0">&lt;?</span>xml <span class="kw7">version</span>=<span class="st0">&quot;1.0&quot;</span> encoding=<span class="st0">&quot;utf-8&quot;</span><span class="sy0">?&gt;</span>
<span class="sy0">&lt;</span>s<span class="sy0">:</span>WindowedApplication xmlns<span class="sy0">:</span>fx=<span class="st0">&quot;http://ns.adobe.com/mxml/2009&quot;</span>
                       xmlns<span class="sy0">:</span>s=<span class="st0">&quot;library://ns.adobe.com/flex/spark&quot;</span>
                       xmlns<span class="sy0">:</span>mx=<span class="st0">&quot;library://ns.adobe.com/flex/mx&quot;</span>
                       <span class="kw7">width</span>=<span class="st0">&quot;200&quot;</span> <span class="kw7">height</span>=<span class="st0">&quot;200&quot;</span><span class="sy0">&gt;</span>
    <span class="sy0">&lt;</span>fx<span class="sy0">:</span>Declarations<span class="sy0">&gt;</span>
        <span class="sy0">&lt;</span>s<span class="sy0">:</span>ArrayCollection id=<span class="st0">&quot;airParams&quot;</span> <span class="sy0">/&gt;</span>
    <span class="sy0">&lt;/</span>fx<span class="sy0">:</span>Declarations<span class="sy0">&gt;</span>
&nbsp;
    <span class="sy0">&lt;</span>s<span class="sy0">:</span>invoke<span class="sy0">&gt;</span>
        <span class="sy0">&lt;!</span><span class="br0">&#91;</span>CDATA<span class="br0">&#91;</span>
        <span class="kw2">var</span> invocation<span class="sy0">:</span>InvokeEvent = InvokeEvent<span class="br0">&#40;</span>event<span class="br0">&#41;</span><span class="sy0">;</span>
        <span class="kw1">for</span> <span class="kw1">each</span><span class="br0">&#40;</span><span class="kw2">var</span> argument<span class="sy0">:</span><span class="kw5">String</span> <span class="kw1">in</span> invocation<span class="sy0">.</span><span class="kw5">arguments</span><span class="br0">&#41;</span>
            airParams<span class="sy0">.</span>addItem<span class="br0">&#40;</span>argument<span class="br0">&#41;</span><span class="sy0">;</span>
        <span class="br0">&#93;</span><span class="br0">&#93;</span><span class="sy0">&gt;</span>
    <span class="sy0">&lt;/</span>s<span class="sy0">:</span>invoke<span class="sy0">&gt;</span>
&nbsp;
    <span class="sy0">&lt;</span>s<span class="sy0">:</span>List dataProvider=<span class="st0">&quot;{airParams}&quot;</span>
            <span class="kw7">width</span>=<span class="st0">&quot;100%&quot;</span> <span class="kw7">height</span>=<span class="st0">&quot;100%&quot;</span> <span class="sy0">/&gt;</span>
&nbsp;
<span class="sy0">&lt;/</span>s<span class="sy0">:</span>WindowedApplication<span class="sy0">&gt;</span></pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                       xmlns:s="library://ns.adobe.com/flex/spark"
                       xmlns:mx="library://ns.adobe.com/flex/mx"
                       width="200" height="200"&gt;
    &lt;fx:Declarations&gt;
        &lt;s:ArrayCollection id="airParams" /&gt;
    &lt;/fx:Declarations&gt;

    &lt;s:invoke&gt;
        &lt;![CDATA[
        var invocation:InvokeEvent = InvokeEvent(event);
        for each(var argument:String in invocation.arguments)
            airParams.addItem(argument);
        ]]&gt;
    &lt;/s:invoke&gt;

    &lt;s:List dataProvider="{airParams}"
            width="100%" height="100%" /&gt;

&lt;/s:WindowedApplication&gt;</pre>
</div>
</div>
<h3>Test it from the command line:</h3>
<ol>
<li>Multiple parameters:<br />
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="actionscript3">
<pre class="de1">adl InvokeExample<span class="sy0">-</span>app<span class="sy0">.</span>xml <span class="sy0">./</span> <span class="sy0">--</span> hello world</pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">adl InvokeExample-app.xml ./ -- hello world</pre>
</div>
</div>
<p><a href="http://zoltanb.co.uk/wp-content/uploads/2011/07/Screen-shot-2011-07-03-at-13.55.01.png"><img class="alignnone size-full wp-image-393" title="Screen shot 2011-07-03 at 13.55.01" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/Screen-shot-2011-07-03-at-13.55.01.png" alt="Screen shot 2011 07 03 at 13.55.01 How to pass in parameters to a Flex Air app at startup" width="280" height="302" /></a></li>
<li>Multiple multi-word parameters:<br />
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="bash">
<pre class="de1">adl InvokeExample-app.xml .<span class="sy0">/</span> <span class="re5">--</span> <span class="st0">&quot;green eggs&quot;</span> <span class="st0">&quot;and ham&quot;</span></pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">adl InvokeExample-app.xml ./ -- "green eggs" "and ham"</pre>
</div>
</div>
<p><a href="http://zoltanb.co.uk/wp-content/uploads/2011/07/Screen-shot-2011-07-03-at-13.57.05.png"><img class="alignnone size-full wp-image-394" title="Screen shot 2011-07-03 at 13.57.05" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/Screen-shot-2011-07-03-at-13.57.05.png" alt="Screen shot 2011 07 03 at 13.57.05 How to pass in parameters to a Flex Air app at startup" width="280" height="302" /></a></li>
<li>Speechmarks &#8211; simply escape them out:<br />
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="bash">
<pre class="de1">adl InvokeExample-app.xml .<span class="sy0">/</span> <span class="re5">--</span> <span class="st0">&quot;<span class="es1">\&quot;</span>green<span class="es1">\&quot;</span> eggs&quot;</span> <span class="st0">&quot;and ham&quot;</span></pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">adl InvokeExample-app.xml ./ -- "\"green\" eggs" "and ham"</pre>
</div>
</div>
<p><a href="http://zoltanb.co.uk/wp-content/uploads/2011/07/Screen-shot-2011-07-03-at-17.28.24.png"><img class="alignnone size-full wp-image-397" title="Screen shot 2011-07-03 at 17.28.24" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/Screen-shot-2011-07-03-at-17.28.24.png" alt="Screen shot 2011 07 03 at 17.28.24 How to pass in parameters to a Flex Air app at startup" width="280" height="302" /></a></li>
</ol>
<h3>Test it with custom file extension</h3>
<p>You can register custom file extensions with your air app. When you open a file with a registered extension, the OS will open your air app and pass in the full path of the file as a parameter.</p>
<ol>
<li>Add your file extension in your application descriptor xml:

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;"><div class="actionscript3"><pre class="de1"><span class="sy0">&lt;</span>fileTypes<span class="sy0">&gt;</span>
&nbsp; &nbsp;<span class="sy0">&lt;</span>fileType<span class="sy0">&gt;</span>
&nbsp; &nbsp; &nbsp;<span class="sy0">&lt;</span>name<span class="sy0">&gt;</span>InvokeExample<span class="sy0">&lt;/</span>name<span class="sy0">&gt;</span>
&nbsp; &nbsp; &nbsp;<span class="sy0">&lt;</span>extension<span class="sy0">&gt;</span>meow<span class="sy0">&lt;/</span>extension<span class="sy0">&gt;</span>
&nbsp; &nbsp; &nbsp;<span class="sy0">&lt;</span>contentType<span class="sy0">&gt;</span>text<span class="sy0">/</span>xml<span class="sy0">&lt;/</span>contentType<span class="sy0">&gt;</span>
&nbsp; &nbsp;<span class="sy0">&lt;/</span>fileType<span class="sy0">&gt;</span>
&nbsp;<span class="sy0">&lt;/</span>fileTypes<span class="sy0">&gt;</span></pre></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">&lt;fileTypes&gt;
   &lt;fileType&gt;
     &lt;name&gt;InvokeExample&lt;/name&gt;
     &lt;extension&gt;meow&lt;/extension&gt;
     &lt;contentType&gt;text/xml&lt;/contentType&gt;
   &lt;/fileType&gt;
 &lt;/fileTypes&gt;</pre></div></div>

</li>
<li>Publish &amp; install your app.</li>
<li>Create a test file and double click on it:<br />
<a href="http://zoltanb.co.uk/wp-content/uploads/2011/07/Screen-shot-2011-07-03-at-17.38.03.png"><img class="alignnone size-full wp-image-398" title="Screen shot 2011-07-03 at 17.38.03" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/Screen-shot-2011-07-03-at-17.38.03.png" alt="Screen shot 2011 07 03 at 17.38.03 How to pass in parameters to a Flex Air app at startup" width="103" height="50" /></a><br />
<a href="http://zoltanb.co.uk/wp-content/uploads/2011/07/Screen-shot-2011-07-03-at-17.38.19.png"><img class="alignnone size-full wp-image-399" title="Screen shot 2011-07-03 at 17.38.19" src="http://zoltanb.co.uk/wp-content/uploads/2011/07/Screen-shot-2011-07-03-at-17.38.19.png" alt="Screen shot 2011 07 03 at 17.38.19 How to pass in parameters to a Flex Air app at startup" width="303" height="274" /></a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://zoltanb.co.uk/how-to-pass-in-parameters-to-a-flex-air-app-at-startup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex Datagram Server</title>
		<link>http://zoltanb.co.uk/flex-datagram-server/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=flex-datagram-server</link>
		<comments>http://zoltanb.co.uk/flex-datagram-server/#comments</comments>
		<pubDate>Thu, 30 Jun 2011 09:32:39 +0000</pubDate>
		<dc:creator>zoltanb</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[datagram]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[parsley]]></category>
		<category><![CDATA[udp]]></category>

		<guid isPermaLink="false">http://zoltanb.co.uk/?p=350</guid>
		<description><![CDATA[<p>DatagramServer is small library for Flex+Parsley that allows you to set up and manage a UDP listener in your Air 2.5+ application.</p> <p></p> UDP Packets in Flex Air apps <p>Datagram packets are ideal for gathering data from external devices without having to establish two-way persistent socket connections. Perfect for gathering logs, benchmark data, statistics, &#8230;etc.</p> [...]]]></description>
			<content:encoded><![CDATA[<p>DatagramServer is small library for Flex+Parsley that allows you to set up and manage a UDP listener in your Air 2.5+ application.</p>
<p><span id="more-350"></span></p>
<h2>UDP Packets in Flex Air apps</h2>
<p>Datagram packets are ideal for gathering data from external devices  without having to establish two-way persistent socket connections. Perfect for gathering logs, benchmark data, statistics, &#8230;etc.</p>
<blockquote><p><strong>Note:</strong> You can send and receive UDP packets in Air 2.5+, but only on desktop Air apps. MobileDevice, extendedMobileDevice, tv, extendedTV profiles are unsupported.</p></blockquote>
<p>You can download the DatagramServer swc from github:</p>
<blockquote><p><a title="DatagramServer" href="https://github.com/mere/DatagramServer" target="_blank">https://github.com/mere/DatagramServer</a></p></blockquote>
<h2>Setup</h2>
<ol>
<li>In your Parsley contextbuilder register DatagramServerContext:<br />
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="actionscript3">
<pre class="de1"><span class="sy0">&lt;</span>parsley<span class="sy0">:</span>FlexConfig <span class="kw7">type</span>=<span class="st0">&quot;{ DatagramServerContext }&quot;</span><span class="sy0">/&gt;</span></pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">&lt;parsley:FlexConfig type="{ DatagramServerContext }"/&gt;</pre>
</div>
</div>
</li>
<li>If you want to edit the datagram host and port from the UI, fastinject DatagramModel, then create a two way binding to .host and .port:<br />
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="actionscript3">
<pre class="de1"><span class="sy0">&lt;</span>s<span class="sy0">:</span>TextInput <span class="kw7">text</span>=<span class="st0">&quot;@{data.host}&quot;</span> <span class="kw7">width</span>=<span class="st0">&quot;120&quot;</span> <span class="sy0">/&gt;</span>
<span class="sy0">&lt;</span>s<span class="sy0">:</span>TextInput <span class="kw7">text</span>=<span class="st0">&quot;@{data.port}&quot;</span> <span class="kw7">width</span>=<span class="st0">&quot;40&quot;</span> <span class="sy0">/&gt;</span></pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">&lt;s:TextInput text="@{data.host}" width="120" /&gt;
&lt;s:TextInput text="@{data.port}" width="40" /&gt;</pre>
</div>
</div>
</li>
<li>Start/Stop the Datagram server from any parsley-managed class, eg.::<br />
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="actionscript3">
<pre class="de1">dispatcher<span class="br0">&#40;</span><span class="kw1">new</span> <span class="kw5">Event</span><span class="br0">&#40;</span>DatagramServerEvent<span class="sy0">.</span>START<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
dispatcher<span class="br0">&#40;</span><span class="kw1">new</span> <span class="kw5">Event</span><span class="br0">&#40;</span>DatagramServerEvent<span class="sy0">.</span>STOP<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">dispatcher(new Event(DatagramServerEvent.START));
dispatcher(new Event(DatagramServerEvent.STOP));</pre>
</div>
</div>
</li>
<li>To listen to incoming UDP packages, create a parsley messagehandler:<br />
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="actionscript3">
<pre class="de1"><span class="br0">&#91;</span>MessageHandler<span class="br0">&#93;</span>
<span class="kw1">public</span> <span class="kw3">function</span> dataReceived<span class="br0">&#40;</span>e<span class="sy0">:</span>DataReceivedEvent<span class="br0">&#41;</span><span class="sy0">:</span><span class="kw1">void</span>
<span class="br0">&#123;</span>
&nbsp; &nbsp; logs<span class="sy0">.</span><span class="kw7">add</span><span class="br0">&#40;</span>e<span class="sy0">.</span>string<span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp; &nbsp; <span class="coMULTI">/**
&nbsp; &nbsp; * you can also use:
&nbsp; &nbsp; * e.ip     : returns the IP of the sender
&nbsp; &nbsp; * e.data     : returns the packet as a bytearray
&nbsp; &nbsp; * e.xml     : returns the packet as xml
&nbsp; &nbsp; */</span>
<span class="br0">&#125;</span></pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">[MessageHandler]
public function dataReceived(e:DataReceivedEvent):void
{
    logs.add(e.string);
    /**
    * you can also use:
    * e.ip     : returns the IP of the sender
    * e.data     : returns the packet as a bytearray
    * e.xml     : returns the packet as xml
    */
}</pre>
</div>
</div>
</li>
</ol>
<h2>How to test your Datagram Listener</h2>
<p>You can use Netcat to send udp packages. On a mac:</p>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="bash">
<pre class="de1">nc <span class="re5">-u</span> your.ip.address port</pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">nc -u your.ip.address port</pre>
</div>
</div>
<h2>Example</h2>
<p>Check out: <a title="DatagramServerExample" href="https://github.com/mere/DatagramServerExample" target="_blank">https://github.com/mere/DatagramServerExample</a></p>
<p><a href="http://zoltanb.co.uk/wp-content/uploads/2011/06/Screen-shot-2011-06-30-at-10.31.04.png"><img class="alignnone size-full wp-image-375" title="Screen shot 2011-06-30 at 10.31.04" src="http://zoltanb.co.uk/wp-content/uploads/2011/06/Screen-shot-2011-06-30-at-10.31.04.png" alt="Screen shot 2011 06 30 at 10.31.04 Flex Datagram Server" width="274" height="59" /></a></p>
<p><a href="http://zoltanb.co.uk/wp-content/uploads/2011/06/Screen-shot-2011-06-30-at-10.31.36.png"><img class="alignnone size-full wp-image-376" title="Screen shot 2011-06-30 at 10.31.36" src="http://zoltanb.co.uk/wp-content/uploads/2011/06/Screen-shot-2011-06-30-at-10.31.36.png" alt="Screen shot 2011 06 30 at 10.31.36 Flex Datagram Server" width="580" height="477" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://zoltanb.co.uk/flex-datagram-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scala + apparat development in Flash Builder</title>
		<link>http://zoltanb.co.uk/scala-apparat-development-in-flash-builder/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=scala-apparat-development-in-flash-builder</link>
		<comments>http://zoltanb.co.uk/scala-apparat-development-in-flash-builder/#comments</comments>
		<pubDate>Tue, 28 Jun 2011 20:47:00 +0000</pubDate>
		<dc:creator>zoltanb</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[apparat]]></category>
		<category><![CDATA[FDT]]></category>
		<category><![CDATA[flash builder]]></category>
		<category><![CDATA[scala]]></category>

		<guid isPermaLink="false">http://zoltanb.co.uk/?p=334</guid>
		<description><![CDATA[<p>If you want to create scala applications using Joa Ebert&#8217;s apparat framework, you can do this straight from Flash Builder with the Scala IDE plugin. The installation process is the same for FDT.</p> <p></p> <p>Unfortunately the Scala IDE for Helios is not available via the Eclipse Marketplace, so you have to install it using the [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to create scala applications using Joa Ebert&#8217;s apparat framework, you can do this straight from Flash Builder with the Scala IDE plugin. The installation process is the same for FDT.</p>
<p><span id="more-334"></span></p>
<p>Unfortunately the Scala IDE for Helios is not available via the Eclipse Marketplace, so you have to install it using the Update Site.</p>
<h2>How to install Scala IDE in Flash Builder</h2>
<ol>
<li>Go to scala-ide update site:
<p>http://download.scala-ide.org/releases/2.0.0-beta</p>
<p>Select <strong>JDT Weaving for Scala</strong>(required for Scala IDE) and <strong>Scala IDE for Eclipse</strong><br />
<a href="http://zoltanb.co.uk/wp-content/uploads/2011/06/Screen-shot-2011-06-28-at-15.23.48.png"><img class="alignnone size-full wp-image-335" title="Screen shot 2011-06-28 at 15.23.48" src="http://zoltanb.co.uk/wp-content/uploads/2011/06/Screen-shot-2011-06-28-at-15.23.48.png" alt="Screen shot 2011 06 28 at 15.23.48 Scala + apparat development in Flash Builder" width="605" height="733" /></a></li>
<li>Click <strong>next, accept t&amp;c, finish, restart FB</strong> when prompted</li>
<li>Depending on your existing plugins, you might get a diagnostics popup. Just click ok.<br />
<a href="http://zoltanb.co.uk/wp-content/uploads/2011/06/Screen-shot-2011-06-28-at-18.08.27.png"><img class="alignnone size-full wp-image-342" title="Screen shot 2011-06-28 at 18.08.27" src="http://zoltanb.co.uk/wp-content/uploads/2011/06/Screen-shot-2011-06-28-at-18.08.27.png" alt="Screen shot 2011 06 28 at 18.08.27 Scala + apparat development in Flash Builder" width="596" height="224" /></a></li>
<li>For Scala development switch over Scala View:<br />
go to <strong>window&gt;Open Perspective&gt;Other&#8230;</strong><br />
Select Scala:<br />
<a href="http://zoltanb.co.uk/wp-content/uploads/2011/06/Screen-shot-2011-06-28-at-20.50.35.png"><img class="alignnone size-full wp-image-343" title="Screen shot 2011-06-28 at 20.50.35" src="http://zoltanb.co.uk/wp-content/uploads/2011/06/Screen-shot-2011-06-28-at-20.50.35.png" alt="Screen shot 2011 06 28 at 20.50.35 Scala + apparat development in Flash Builder" width="353" height="383" /></a></li>
<li>That&#8217;s it!<br />
You should get .scala syntax highlighting, code completion, compile and debug options in this view.<br />
<a href="http://zoltanb.co.uk/wp-content/uploads/2011/06/Screen-shot-2011-06-28-at-21.02.42.png"><img class="alignnone size-full wp-image-344" title="Screen shot 2011-06-28 at 21.02.42" src="http://zoltanb.co.uk/wp-content/uploads/2011/06/Screen-shot-2011-06-28-at-21.02.42.png" alt="Screen shot 2011 06 28 at 21.02.42 Scala + apparat development in Flash Builder" width="203" height="240" /></a></li>
</ol>
<blockquote><p>&nbsp;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://zoltanb.co.uk/scala-apparat-development-in-flash-builder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to setup and configure Sonar for Groovy projects</title>
		<link>http://zoltanb.co.uk/how-to-setup-and-configure-sonar-for-groovy-projects/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-setup-and-configure-sonar-for-groovy-projects</link>
		<comments>http://zoltanb.co.uk/how-to-setup-and-configure-sonar-for-groovy-projects/#comments</comments>
		<pubDate>Tue, 28 Jun 2011 12:15:48 +0000</pubDate>
		<dc:creator>zoltanb</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[sonar]]></category>
		<category><![CDATA[sts]]></category>

		<guid isPermaLink="false">http://zoltanb.co.uk/?p=312</guid>
		<description><![CDATA[<p>Sonar is an open platform to manage code quality. Sonar can gather data from your Groovy projects and display them on a web interface or straight in SpringSource Toolkit via an eclipse plugin.</p> <p></p> 1. How to enable analysis of your Groovy projects If your project is not mavenised, you will need to create a [...]]]></description>
			<content:encoded><![CDATA[<p>Sonar is an open platform to manage code quality. Sonar can gather data from your Groovy projects and display them on a web interface or straight in SpringSource Toolkit via an eclipse plugin.</p>
<p><span id="more-312"></span></p>
<h2>1. How to enable analysis of your Groovy projects</h2>
<ol>
<li>If your project is not mavenised, you will need to create a pom.xml.<br />
cd into your project folder and run:&nbsp;</p>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="actionscript3">
<pre class="de1">mvn org<span class="sy0">.</span>grails<span class="sy0">:</span>grails<span class="sy0">-</span>maven<span class="sy0">-</span>plugin<span class="sy0">:</span>1<span class="sy0">.</span>3<span class="sy0">.</span>7<span class="sy0">:</span>create<span class="sy0">-</span>pom <span class="sy0">-</span>DgroupId=YOURGROUPID</pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">mvn org.grails:grails-maven-plugin:1.3.7:create-pom -DgroupId=YOURGROUPID</pre>
</div>
</div>
</li>
<li>Edit your pom xml. Add:<br />
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="actionscript3">
<pre class="de1">&nbsp;<span class="sy0">&lt;</span>sourceDirectory<span class="sy0">&gt;</span>src<span class="sy0">/</span>main<span class="sy0">/</span>groovy<span class="sy0">&lt;/</span>sourceDirectory<span class="sy0">&gt;</span>
&nbsp;<span class="sy0">&lt;</span>properties<span class="sy0">&gt;</span>
&nbsp; &nbsp; <span class="sy0">&lt;</span>sonar<span class="sy0">.</span>language<span class="sy0">&gt;</span>grvy<span class="sy0">&lt;/</span>sonar<span class="sy0">.</span>language<span class="sy0">&gt;</span>
&nbsp; &nbsp; <span class="sy0">&lt;</span>sonar<span class="sy0">.</span>dynamicAnalysis<span class="sy0">&gt;</span>false<span class="sy0">&lt;/</span>sonar<span class="sy0">.</span>dynamicAnalysis<span class="sy0">&gt;</span>
&nbsp;<span class="sy0">&lt;/</span>properties<span class="sy0">&gt;</span></pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse"> &lt;sourceDirectory&gt;src/main/groovy&lt;/sourceDirectory&gt;
 &lt;properties&gt;
    &lt;sonar.language&gt;grvy&lt;/sonar.language&gt;
    &lt;sonar.dynamicAnalysis&gt;false&lt;/sonar.dynamicAnalysis&gt;
 &lt;/properties&gt;</pre>
</div>
</div>
</li>
</ol>
<h2>2. How to add your project to the sonar console</h2>
<ol>
<li>You need to install the Flex plugin to enable analysis of AS3 and flex projects:<br />
Go to System&gt;Update Center:<br />
<a href="../wp-content/uploads/2011/06/Screen-shot-2011-06-24-at-14.36.38.png"><img title="Screen shot 2011-06-24 at 14.36.38" src="../wp-content/uploads/2011/06/Screen-shot-2011-06-24-at-14.36.38.png" alt="Screen shot 2011 06 24 at 14.36.38 How to setup and configure Sonar for Groovy projects" width="157" height="111" /></a></li>
<li>Under Available plugins find Groovy and click install:<br />
<a href="http://zoltanb.co.uk/wp-content/uploads/2011/06/Screen-shot-2011-06-27-at-16.01.05.png"><img class="alignnone size-full wp-image-322" title="Screen shot 2011-06-27 at 16.01.05" src="http://zoltanb.co.uk/wp-content/uploads/2011/06/Screen-shot-2011-06-27-at-16.01.05.png" alt="Screen shot 2011 06 27 at 16.01.05 How to setup and configure Sonar for Groovy projects" width="482" height="255" /></a></li>
<li>Restart sonar:
<div>
<div>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="actionscript3">
<pre class="de1">macosx<span class="sy0">-</span>universal<span class="sy0">-</span><span class="nu0">64</span><span class="sy0">/</span>sonar<span class="sy0">.</span>sh <span class="kw7">stop</span>
macosx<span class="sy0">-</span>universal<span class="sy0">-</span><span class="nu0">64</span><span class="sy0">/</span>sonar<span class="sy0">.</span>sh console
<span class="sy0">..</span>or the linux<span class="sy0">/</span>windows equivalent<span class="sy0">...</span></pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">macosx-universal-64/sonar.sh stop
macosx-universal-64/sonar.sh console
..or the linux/windows equivalent...</pre>
</div>
</div>
</div>
</div>
</li>
<li>Go to the sonar profiles page.<br />
If you installed sonar locally, the default url is:&nbsp;</p>
<div>
<div>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="actionscript3">
<pre class="de1">http<span class="sy0">:</span><span class="co1">//localhost:9000/profiles/projects/</span></pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">http://localhost:9000/profiles/projects/</pre>
</div>
</div>
</div>
</div>
<p>If the installation was successful, you should see a ‘<strong>Sonar Groovy Way</strong><strong> </strong>‘ section:<br />
<a href="http://zoltanb.co.uk/wp-content/uploads/2011/06/Screen-shot-2011-06-28-at-13.11.51.png"><img class="alignnone size-full wp-image-323" title="Screen shot 2011-06-28 at 13.11.51" src="http://zoltanb.co.uk/wp-content/uploads/2011/06/Screen-shot-2011-06-28-at-13.11.51.png" alt="Screen shot 2011 06 28 at 13.11.51 How to setup and configure Sonar for Groovy projects" width="453" height="80" /></a></li>
</ol>
<h2>3. How to gather data from your Groovy project and analyse it in Sonar</h2>
<ol>
<li>cd into your project folder. Clean and Install your project into your local maven repo:<br />
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="actionscript3">
<pre class="de1">mvn clean install</pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">mvn clean install</pre>
</div>
</div>
</li>
<li>run the sonar analysis:<br />
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="actionscript3">
<pre class="de1">mvn sonar<span class="sy0">:</span>sonar</pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">mvn sonar:sonar</pre>
</div>
</div>
</li>
<li> Go to your Sonar profile page. For local installs the default url is: <em>http://localhost:9000/profiles</em></li>
<li> Click on <strong>+Create</strong> or ‘<strong>Sonar Groovy Way</strong>‘ and  add your project to the associated projects:<a href="http://zoltanb.co.uk/wp-content/uploads/2011/06/groovyprofile.png"><img class="alignnone size-full wp-image-315" title="groovyprofile" src="http://zoltanb.co.uk/wp-content/uploads/2011/06/groovyprofile.png" alt="groovyprofile How to setup and configure Sonar for Groovy projects" width="514" height="294" /></a></li>
<li>Go back to your sonar web interface (<em>http://localhost:9000</em>) –  the reports on all gathered data should be displayed.</li>
</ol>
<h2>4. How to install and configure the Sonar Eclipse Plugin in STS</h2>
<ol>
<li>Go to <strong>Help&gt;Install New software</strong><br />
Enter the Sonar Update Site:&nbsp;</p>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;">
<div class="actionscript3">
<pre class="de1">http<span class="sy0">:</span><span class="co1">//dist.sonar-ide.codehaus.org/eclipse/</span></pre>
</div>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">http://dist.sonar-ide.codehaus.org/eclipse/</pre>
</div>
</div>
<p><a href="http://zoltanb.co.uk/wp-content/uploads/2011/06/Screen-shot-2011-06-27-at-17.39.37.png"><img class="alignnone size-full wp-image-313" title="Screen shot 2011-06-27 at 17.39.37" src="http://zoltanb.co.uk/wp-content/uploads/2011/06/Screen-shot-2011-06-27-at-17.39.37.png" alt="Screen shot 2011 06 27 at 17.39.37 How to setup and configure Sonar for Groovy projects" width="624" height="604" /></a></li>
<li>Click<strong> Next, Accept T&amp;C, Reboot STS</strong> when prompted</li>
<li>go to <strong>preferences</strong>, type in sonar to the filter:<br />
<a href="http://zoltanb.co.uk/wp-content/uploads/2011/06/Screen-shot-2011-06-27-at-11.49.36.png"><img title="Screen shot 2011-06-27 at 11.49.36" src="http://zoltanb.co.uk/wp-content/uploads/2011/06/Screen-shot-2011-06-27-at-11.49.36.png" alt="Screen shot 2011 06 27 at 11.49.36 How to setup and configure Sonar for Groovy projects" width="618" height="365" /></a>If you are running sonar on http://localhost:9000/ , then you don&#8217;t need to do anything.<br />
If your are running on a different host:port, <strong>click on add</strong> and and add a new Sonar Server URL.</li>
<li>To verify the connection you can click on edit and click on Test Connection. In the console you should get:

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"style="width: 600px;"><div class="bash"><pre class="de1"><span class="br0">&#91;</span>INFO<span class="br0">&#93;</span> Connected to Sonar <span class="nu0">2.8</span></pre></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">[INFO] Connected to Sonar 2.8</pre></div></div>

</li>
<li>Right click on your project in the Project explorer, go to <strong>Configure &gt; Associate with Sonar</strong>:<br />
<a href="http://zoltanb.co.uk/wp-content/uploads/2011/06/Screen-shot-2011-06-27-at-17.54.42.png"><img class="alignnone size-full wp-image-317" title="Screen shot 2011-06-27 at 17.54.42" src="http://zoltanb.co.uk/wp-content/uploads/2011/06/Screen-shot-2011-06-27-at-17.54.42.png" alt="Screen shot 2011 06 27 at 17.54.42 How to setup and configure Sonar for Groovy projects" width="517" height="85" /></a></li>
<li>1. Select your Sonar server from the dropdown list<br />
2. Copy the <strong>GroupID</strong> and <strong>ArtifactID</strong> from your pom.xml<br />
3. Click on Find on Server<a href="http://zoltanb.co.uk/wp-content/uploads/2011/06/Screen-shot-2011-06-27-at-18.01.32.png"><img class="alignnone size-full wp-image-318" title="Screen shot 2011-06-27 at 18.01.32" src="http://zoltanb.co.uk/wp-content/uploads/2011/06/Screen-shot-2011-06-27-at-18.01.32.png" alt="Screen shot 2011 06 27 at 18.01.32 How to setup and configure Sonar for Groovy projects" width="562" height="414" /></a></li>
<li>Switch over to Sonar View:<br />
<a href="http://zoltanb.co.uk/wp-content/uploads/2011/06/Screen-shot-2011-06-28-at-13.22.43.png"><img class="alignleft size-full wp-image-328" title="Screen shot 2011-06-28 at 13.22.43" src="http://zoltanb.co.uk/wp-content/uploads/2011/06/Screen-shot-2011-06-28-at-13.22.43.png" alt="Screen shot 2011 06 28 at 13.22.43 How to setup and configure Sonar for Groovy projects" width="217" height="166" /></a><a href="http://zoltanb.co.uk/wp-content/uploads/2011/06/Screen-shot-2011-06-28-at-13.24.04.png"><img class="size-full wp-image-329 alignnone" title="Screen shot 2011-06-28 at 13.24.04" src="http://zoltanb.co.uk/wp-content/uploads/2011/06/Screen-shot-2011-06-28-at-13.24.04.png" alt="Screen shot 2011 06 28 at 13.24.04 How to setup and configure Sonar for Groovy projects" width="353" height="383" /></a></li>
<li>If the sonar analysis was successful, your Measures, Web, Hotspots and Violations panel will be populated with the gathered data.</li>
</ol>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://zoltanb.co.uk/how-to-setup-and-configure-sonar-for-groovy-projects/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Flash/Flex Development on Scientific Linux</title>
		<link>http://zoltanb.co.uk/flash-flex-development-on-scientific-linux/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=flash-flex-development-on-scientific-linux</link>
		<comments>http://zoltanb.co.uk/flash-flex-development-on-scientific-linux/#comments</comments>
		<pubDate>Fri, 24 Jun 2011 20:40:30 +0000</pubDate>
		<dc:creator>zoltanb</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[FDT]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[scientific linux]]></category>

		<guid isPermaLink="false">http://zoltanb.co.uk/?p=292</guid>
		<description><![CDATA[<p>If you want to use a linux box for testing/developing AS3/Flex apps, you are likely to come across some obstacles:</p> <p></p> Flash Builder is no longer supported on Linux. The last available version is FB3.<br /> (ok, there&#8217;s the barely legal <a title="fb4linux" href="http://code.google.com/p/fb4linux/">FB4Linux</a>, too&#8230;.) Air Development is no longer supported on Linux. Air 2.7 [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to use a linux box for testing/developing AS3/Flex apps, you are likely to come across some obstacles:</p>
<p><span id="more-292"></span></p>
<ul>
<li>Flash Builder is no longer supported on Linux. The last available version is FB3.<br />
(ok, there&#8217;s the barely legal <a title="fb4linux" href="http://code.google.com/p/fb4linux/">FB4Linux</a>, too&#8230;.)</li>
<li>Air Development is no longer supported on Linux. Air 2.7 SDK is only available for Mac and Windows:<br />
<a rel="nofollow" href="http://www.adobe.com/products/air/sdk/">http://www.adobe.com/products/air/sdk/<br />
</a></li>
<li>Air runtime is no longer developed for Linux.<br />
<a rel="nofollow" href="http://blogs.adobe.com/open/2011/06/focusing-on-the-next-linux-client.html">http://blogs.adobe.com/open/2011/06/focusing-on-the-next-linux-client.html</a></li>
<li>the ADL file that ships with the Flex 4.5 SDK is built for Mac. The Linux Air package is built for Flex 4.0.</li>
<li>&#8230;and so on.</li>
</ul>
<p>That said, it is possible to set up a stable development environment on Linux.<br />
FDT is still supported on Linux and the Flex 4.5 SDK + Air 2.6 SDK can be tweaked to work on linux.<br />
Check out the following 2 articles about setting up the SDKs and the dev tools on Scientific Linux:</p>
<ul>
<li>
<h3><a title="How to set up a complete flash flex or air development environment on linux" href="http://zoltanb.co.uk/how-to-set-up-a-complete-flash-flex-air-development-environment-on-linux/">How to set up a complete flash flex or air development environment on linux</a></h3>
</li>
<li>
<h3><a title="How to set up Flex 4.5 SDK with Air 2.6 on Linux using FDT" href="http://zoltanb.co.uk/how-to-set-up-flex-4-5-sdk-with-air-2-6-on-linux-using-fdt/">How to set up Flex 4.5 SDK with Air 2.6 on Linux using FDT</a></h3>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://zoltanb.co.uk/flash-flex-development-on-scientific-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Object Caching 2942/3074 objects using disk: basic

Served from: zoltanb.co.uk @ 2012-02-22 22:11:40 -->
