<?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>MikeCann.co.uk &#187; Programming - MikeCann.co.uk - mikey see, mikey do!</title>
	<atom:link href="http://mikecann.co.uk/tag/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://mikecann.co.uk</link>
	<description>mikey see, mikey do!</description>
	<lastBuildDate>Sat, 28 Jan 2012 13:10:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>GPU State Preserving Particle Systems with WebGL &amp; HaXe</title>
		<link>http://mikecann.co.uk/personal-project/gpu-state-preserving-particle-systems-with-webgl-haxe/</link>
		<comments>http://mikecann.co.uk/personal-project/gpu-state-preserving-particle-systems-with-webgl-haxe/#comments</comments>
		<pubDate>Thu, 20 Oct 2011 12:02:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[GLSL]]></category>
		<category><![CDATA[HaXe]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Personal Projects]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[WebGL]]></category>
		<category><![CDATA[complex]]></category>
		<category><![CDATA[glsl]]></category>
		<category><![CDATA[gpu]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[haxe]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Particles]]></category>

		<guid isPermaLink="false">http://mikecann.co.uk/?p=1687</guid>
		<description><![CDATA[Well this is the post I didnt think was going to happen. I have been struggling for weeks with this little bit of tech, ill explain more about why it has been so difficult in another post. For now however, ill just talk about this sample. So the idea was to build upon what I had been [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://mikecann.co.uk/wp-content/uploads/2011/10/header01.png"><img class="alignnone size-full wp-image-1688" title="header01" src="http://mikecann.co.uk/wp-content/uploads/2011/10/header01.png" alt="" width="700" height="400" /></a></p>
<p>Well this is the post I didnt think was going to happen. I have been struggling for weeks with this little bit of tech, ill explain more about why it has been so difficult in another post. For now however, ill just talk about this sample.</p>
<p>So the idea was to build upon what I had been working with previously with my <a href="http://mikecann.co.uk/programming/5000000-chrome-crawlers-why-not-haxe-webgl/">stateless particles systems with WebGL and HaXe</a>. The intention from the start was to replicate some of my <a href="http://mikecann.co.uk/university-projects/xnagpuparticles-1000000-dynamic-particles/">very early work</a> (from 2007) on state preserving particle systems in WebGL.</p>
<p><strong>Before I go any further, you can check it out in action here:<br />
</strong><strong><a href="http://mikecann.co.uk/projects/HaxeWebGLParticles/">http://mikecann.co.uk/projects/HaxeWebGLParticles/</a> </strong></p>
<p>First a quick reminder. The difference between a stateless and state-preserving particle simulation is that in the latter we store and update the positions, velocities and other properties of each particle per frame, allowing us to interact and control the simulation. This differs from the stateless particle simulation (detailed in my<a href="http://mikecann.co.uk/programming/5000000-chrome-crawlers-why-not-haxe-webgl/"> previous post</a>), where the position for each particle is calculated each frame based on a fixed algorithm.</p>
<p>A <a href="http://code.google.com/p/angleproject/issues/detail?id=95">fairly reccent addition</a> to WebGL made this possible, namely texture lookups in the vertex shader (aka Vertex Texture Fetch). I wont go over the exact details how this makes state preserving particle systems possible as I have already documented it in <a href="http://mikecann.co.uk/university-projects/xnagpuparticles-1000000-dynamic-particles/">my earlier work</a>. A brief explanation is that it allows you to use the fragment shader to perform the updates on particle state stored in textures then use the vertex shader to map those states to a point-sprite vertex buffer.</p>
<p>Basically what this means is that the entire particle simulation can be contained and updated on the GPU, which means <a href="http://mikecann.co.uk/programming/5000000-chrome-crawlers-why-not-haxe-webgl/">no read-back</a>. This allows us to achieve simulations of <strong>millions</strong> of particles without too much difficulty (depending on GPU ofcourse).</p>
<p><strong>I have uploaded the source for people to perouse at their leisure</strong>:<br />
<a href="https://github.com/mikecann/HaxeWebGLParticles">https://github.com/mikecann/HaxeWebGLParticles</a></p>
<p>As usual it was written using the JS target of HaXe so it should be fairly easy to understand whats going on if you have written any Ecma-script-like-language. Im going to detail this in my next post, but the code isnt the best I have ever written as its a result of a mish-mash of various samples and examples I have found on the web. If anyone has any comments on things that are wrong or could be done better I would be very happy to hear about them.</p>
]]></content:encoded>
			<wfw:commentRss>http://mikecann.co.uk/personal-project/gpu-state-preserving-particle-systems-with-webgl-haxe/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>FlashDevelop Obsidian Dark Theme For HaXe</title>
		<link>http://mikecann.co.uk/personal-project/flashdevelop-obsidian-dark-theme-for-haxe/</link>
		<comments>http://mikecann.co.uk/personal-project/flashdevelop-obsidian-dark-theme-for-haxe/#comments</comments>
		<pubDate>Thu, 21 Jul 2011 19:19:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HaXe]]></category>
		<category><![CDATA[Personal Projects]]></category>
		<category><![CDATA[dark]]></category>
		<category><![CDATA[eyestrain]]></category>
		<category><![CDATA[FlashDevelop]]></category>
		<category><![CDATA[ide]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://mikecann.co.uk/?p=1592</guid>
		<description><![CDATA[&#160; Just a quick update this evening. In an effort to to reduce some of the symptoms of eye strain I have been suffering from recently I decided to change the theme of FlashDevelop4 to something a little darker and easier on the eyes. I took inspiration from the excellent Obsidian theme on the Eclipse Color Themes website. Im still yet [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://mikecann.co.uk/wp-content/uploads/2011/07/Shot_05.png"><img class="alignnone size-full wp-image-1593" title="Shot_05" src="http://mikecann.co.uk/wp-content/uploads/2011/07/Shot_05.png" alt="" width="700" height="400" /></a></p>
<p>&nbsp;</p>
<p>Just a quick update this evening.</p>
<p>In an effort to to reduce some of the symptoms of eye strain I have been suffering from recently I decided to change the theme of FlashDevelop4 to something a little darker and easier on the eyes.</p>
<p>I took inspiration from the excellent <a href="http://www.eclipsecolorthemes.org/?view=theme&amp;id=21">Obsidian theme on the Eclipse Color Themes</a> website.</p>
<p>Im still yet decided if it helps atall, tho I must admit I do like my IDE a little more colorful <img src='http://mikecann.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I have uploaded the theme for download here: <a href="http://mikecann.co.uk/projects/FD4Theme/Obsidian-HaXe.fdz" target="_blank">http://mikecann.co.uk/<wbr>projects/FD4Theme/Obsidian-<wbr>HaXe.fdz</wbr></wbr></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Once downloaded just double click it to install, then restart FD, simples!</p>
<p>After posting the theme to the HaXe mailing list several people linked the themes they use, so if you are interested there&#8217;s <a href="http://haxe.1354130.n2.nabble.com/FlashDevelop-Obsidian-Dark-Theme-td6600305.html">more themes here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://mikecann.co.uk/personal-project/flashdevelop-obsidian-dark-theme-for-haxe/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>More HTML5 &amp; HaXe Speed Tests</title>
		<link>http://mikecann.co.uk/personal-project/more-html5-haxe-speed-tests/</link>
		<comments>http://mikecann.co.uk/personal-project/more-html5-haxe-speed-tests/#comments</comments>
		<pubDate>Sun, 10 Jul 2011 19:13:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HaXe]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Personal Projects]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[haxe]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Project]]></category>
		<category><![CDATA[speed]]></category>

		<guid isPermaLink="false">http://mikecann.co.uk/?p=1583</guid>
		<description><![CDATA[Ive spent a little more time this weekend looking at some more  HTML5 with HaXe. Following on from my previous experiments with WebGL I decided to give HTML5&#8242;s Canvas a a look as it was supposed to be designed specifically for the purpose of doing 2D. I had heard from the HaXe mailing list that the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://mikecann.co.uk/wp-content/uploads/2011/07/header.png"><img class="alignnone size-full wp-image-1584" title="header" src="http://mikecann.co.uk/wp-content/uploads/2011/07/header.png" alt="" width="700" height="400" /></a></p>
<p>Ive spent a little more time this weekend looking at some more  HTML5 with HaXe. Following on from <a href="http://mikecann.co.uk/personal-project/chrome-crawler-haxe-three-js-webgl-and-2d-sprites/">my previous experiments with WebGL</a> I decided to give HTML5&#8242;s Canvas a a look as it was supposed to be designed specifically for the purpose of doing 2D.</p>
<p>I had heard from the HaXe mailing list that the <a href="http://haxe.org/com/libs/jeash">Jeash project</a> was a common way of interacting with the canvas in HaXe. Jeash is a remapping of the Flash API into JS so in effect I should beable to take any of my usual flash code, Sprite&#8217;s,  BitmapData&#8217;s, etc and it should run on the canvas no problems. Nice!</p>
<p>So I coded up a quick blitting example to see what sort of performance I would get:</p>
<p><a href="http://mikecann.co.uk/projects/HTML5SpeedTests/HaXeJeash/bin/">http://mikecann.co.uk/projects/HTML5SpeedTests/HaXeJeash/bin/</a></p>
<p>The results were okay (I get about 11FPS with 5,000 crawlers) however I was interested to know what sort of cost HaXe adds. So I decided to code up a second example, this time using pure JS:</p>
<p><a href="http://mikecann.co.uk/projects/HTML5SpeedTests/JSCanvas/">http://mikecann.co.uk/projects/HTML5SpeedTests/JSCanvas/</a></p>
<p>The results this time were better (14FPS with 5,000 crawlers) so I now wondered what happens if I do without Jeash and just code up the example using pure HaXe. I was expecting to see the same sort of performance hit as Jeash:</p>
<p><a href="http://mikecann.co.uk/projects/HTML5SpeedTests/HaXeCanvas/bin/">http://mikecann.co.uk/projects/HTML5SpeedTests/HaXeCanvas/bin/</a></p>
<p>Surprisingly it actually runs faster (17FPS with 5,000 crawlers) ! This is quite a surprise and totally contradicts my notion that going from HaXe -&gt; JS would incur a cost. I was expecting some cost, but a performance increase?! I can only speculate that behind the scenes the JS engine in the browser is able to JIT compile the HaXe JS much better than the hand-crafted JS and hence more speed.</p>
<p>If you are interested in the source then I have uploaded it here: <a href="http://mikecann.co.uk/projects/HTML5SpeedTests/HTML5SpeedTests_1.zip">http://mikecann.co.uk/projects/HTML5SpeedTests/HTML5SpeedTests_1.zip</a></p>
<p>P.S. All the test were run on Windows 7 x64 in Chrome 14 (dev)</p>
]]></content:encoded>
			<wfw:commentRss>http://mikecann.co.uk/personal-project/more-html5-haxe-speed-tests/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Shader Based 2D Shadowing</title>
		<link>http://mikecann.co.uk/programming/shader-based-2d-shadowing/</link>
		<comments>http://mikecann.co.uk/programming/shader-based-2d-shadowing/#comments</comments>
		<pubDate>Sun, 15 Aug 2010 11:10:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[HLSL]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[XNA]]></category>
		<category><![CDATA[2d]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[hlsl]]></category>
		<category><![CDATA[shader]]></category>
		<category><![CDATA[shadow]]></category>
		<category><![CDATA[university]]></category>

		<guid isPermaLink="false">http://mikecann.co.uk/?p=1206</guid>
		<description><![CDATA[Those who know me know I used to do quite abit of development in c# using Microsoft&#8217;s XNA platform. Well I like to check back in every now and then with some of the big players in the community to see what&#8217;s going on. One of those players is Catalin Zima, who is famous for producing many [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://mikecann.co.uk/wp-content/uploads/2010/08/11_scene.png"><img class="alignnone size-full wp-image-1207" title="11_scene" src="http://mikecann.co.uk/wp-content/uploads/2010/08/11_scene.png" alt="" width="560" height="420" /></a></p>
<p>Those who know me know I used to do <a href="http://mikecann.co.uk/?s=xna">quite abit of development</a> in c# using Microsoft&#8217;s XNA platform.</p>
<p>Well I like to check back in every now and then with some of the big players in the community to see what&#8217;s going on.</p>
<p>One of those players is <a href="http://www.catalinzima.com/">Catalin Zima</a>, who is famous for producing many great shader and effect samples.</p>
<p>One of Catalin&#8217;s reccent project particularly caught my eye however as I had tried to tackle the same problem several years ago when I was in my final year of university. That is, Dynamic 2D Shadows Calculated on the GPU (<a href="http://mikecann.co.uk/university-projects/shadowshader-in-rendermonkey/">http://mikecann.co.uk/university-projects/shadowshader-in-rendermonkey/</a>)</p>
<p><a href="http://www.catalinzima.com/2010/07/my-technique-for-the-shader-based-dynamic-2d-shadows/">Catalin&#8217;s approac</a>h to the problem is far more elegant that my brute force iterative approach. He uses a clever technique of distorting the desired casting image about the light in such a way as not to require iterative pixel lookups.</p>
<p>If you are interested in the more details in the technique I encourage you to check it out over on Catalin&#8217;s blog: <a href="http://www.catalinzima.com/2010/07/my-technique-for-the-shader-based-dynamic-2d-shadows/">http://www.catalinzima.com/2010/07/my-technique-for-the-shader-based-dynamic-2d-shadows/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mikecann.co.uk/programming/shader-based-2d-shadowing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex 4 Spark &amp; Rollover Group Containing Rect</title>
		<link>http://mikecann.co.uk/programming/flex-4-spark-rollover-group-containing-rect/</link>
		<comments>http://mikecann.co.uk/programming/flex-4-spark-rollover-group-containing-rect/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 08:25:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[MXML]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Behaviour]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Expected]]></category>
		<category><![CDATA[Flex4]]></category>
		<category><![CDATA[Group]]></category>
		<category><![CDATA[Rollover]]></category>
		<category><![CDATA[Spark]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://mikecann.co.uk/?p=1159</guid>
		<description><![CDATA[Was working on my top-secret Flex-based project over the weekend when I discovered something I hadn&#8217;t come across before. The issue is that when you have a Spark Rect GraphicsElement within a Spark Group it seems that the rollover event of the group is triggered even though the mouse doesn&#8217;t roll over the Rect. Here is a video I made to [...]]]></description>
			<content:encoded><![CDATA[<p>Was working on my top-secret Flex-based project over the weekend when I discovered something I hadn&#8217;t come across before.</p>
<p>The issue is that when you have a Spark Rect GraphicsElement within a Spark Group it seems that the rollover event of the group is triggered even though the mouse doesn&#8217;t roll over the Rect.</p>
<p>Here is a video I made to explain my issue on Twitter:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="700" height="550" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/9Ku4xY7vfyw&amp;hl=en_GB&amp;fs=1?hd=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="700" height="550" src="http://www.youtube.com/v/9Ku4xY7vfyw&amp;hl=en_GB&amp;fs=1?hd=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>The code in the video is as follows:</p>
<div id="wpshdo_1" class="wp-synhighlighter-outer"><div id="wpshdt_1" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_1"></a><a id="wpshat_1" class="wp-synhighlighter-title" href="#codesyntax_1"  onClick="javascript:wpsh_toggleBlock(1)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_1" onClick="javascript:wpsh_code(1)" title="Show code only"><img border="0" style="border: 0 none" src="http://mikecann.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_1" onClick="javascript:wpsh_print(1)" title="Print code"><img border="0" style="border: 0 none" src="http://mikecann.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://mikecann.co.uk/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://mikecann.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_1" class="wp-synhighlighter-inner" style="display: block;"><pre class="mxml" style="font-family:monospace;"><span class="sc3"><span class="re1">&lt;s:WindowedApplication</span> xmlns:fx=<span class="st0">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span class="sc3">   xmlns:s=<span class="st0">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span class="sc3">   xmlns:mx=<span class="st0">&quot;library://ns.adobe.com/flex/mx&quot;</span><span class="re2">&gt;</span></span> 
&nbsp;
	<span class="sc3"><span class="re1">&lt;s:Group</span> rollOver=<span class="st0">&quot;trace('ya')&quot;</span><span class="re2">&gt;</span></span>
		<span class="sc3"><span class="re1">&lt;s:Rect</span> x=<span class="st0">&quot;100&quot;</span> y=<span class="st0">&quot;100&quot;</span> width=<span class="st0">&quot;20&quot;</span> height=<span class="st0">&quot;20&quot;</span><span class="re2">&gt;</span></span>
			<span class="sc3"><span class="re1">&lt;s:fill</span><span class="re2">&gt;</span></span>
				<span class="sc3"><span class="re1">&lt;s:SolidColor</span> color=<span class="st0">&quot;0x00ff00&quot;</span> <span class="re2">/&gt;</span></span>
			<span class="sc3"><span class="re1">&lt;/s:fill</span><span class="re2">&gt;</span></span>
		<span class="sc3"><span class="re1">&lt;/s:Rect</span><span class="re2">&gt;</span></span>
	<span class="sc3"><span class="re1">&lt;/s:Group</span><span class="re2">&gt;</span></span> 
&nbsp;
<span class="sc3"><span class="re1">&lt;/s:WindowedApplication</span><span class="re2">&gt;</span></span></pre></div></div>
<p>It turns out (after <a href="http://forums.adobe.com/message/3017631#3017631">posting the issue on the Adobe Forums</a>) that I was simply missing the &#8220;mouseEnabledWhereTransparent&#8221; property on the Group. Setting it to false causes the mouse to perform a hit-test rather than a simple bounds check. Thank you Mr Shongrunden for pointing this out to me <img src='http://mikecann.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So this now works:</p>
<div id="wpshdo_2" class="wp-synhighlighter-outer"><div id="wpshdt_2" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_2"></a><a id="wpshat_2" class="wp-synhighlighter-title" href="#codesyntax_2"  onClick="javascript:wpsh_toggleBlock(2)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_2" onClick="javascript:wpsh_code(2)" title="Show code only"><img border="0" style="border: 0 none" src="http://mikecann.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_2" onClick="javascript:wpsh_print(2)" title="Print code"><img border="0" style="border: 0 none" src="http://mikecann.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://mikecann.co.uk/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://mikecann.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_2" class="wp-synhighlighter-inner" style="display: block;"><pre class="php" style="font-family:monospace;"><span class="sy0">&lt;</span>s<span class="sy0">:</span>WindowedApplication xmlns<span class="sy0">:</span>fx<span class="sy0">=</span><span class="st0">&quot;http://ns.adobe.com/mxml/2009&quot;</span>
   xmlns<span class="sy0">:</span>s<span class="sy0">=</span><span class="st0">&quot;library://ns.adobe.com/flex/spark&quot;</span>
   xmlns<span class="sy0">:</span>mx<span class="sy0">=</span><span class="st0">&quot;library://ns.adobe.com/flex/mx&quot;</span><span class="sy0">&gt;</span> 
&nbsp;
	<span class="sy0">&lt;</span>s<span class="sy0">:</span>Group rollOver<span class="sy0">=</span><span class="st0">&quot;trace('ya')&quot;</span> mouseEnabledWhereTransparent<span class="sy0">=</span><span class="st0">&quot;false&quot;</span><span class="sy0">&gt;</span>
		<span class="sy0">&lt;</span>s<span class="sy0">:</span>Rect x<span class="sy0">=</span><span class="st0">&quot;100&quot;</span> y<span class="sy0">=</span><span class="st0">&quot;100&quot;</span> width<span class="sy0">=</span><span class="st0">&quot;20&quot;</span> height<span class="sy0">=</span><span class="st0">&quot;20&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 color<span class="sy0">=</span><span class="st0">&quot;0x00ff00&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>Group<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>
<p>I hope this helps someone else out!</p>
]]></content:encoded>
			<wfw:commentRss>http://mikecann.co.uk/programming/flex-4-spark-rollover-group-containing-rect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Funk IoC &#8211; A New Dependency Injection Framework</title>
		<link>http://mikecann.co.uk/flash/funk-ioc-a-new-dependency-injection-framework/</link>
		<comments>http://mikecann.co.uk/flash/funk-ioc-a-new-dependency-injection-framework/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 20:17:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[Functional]]></category>
		<category><![CDATA[Funk]]></category>
		<category><![CDATA[Impressive]]></category>
		<category><![CDATA[IoC]]></category>
		<category><![CDATA[Robot Legs]]></category>
		<category><![CDATA[Swift Suspenders]]></category>

		<guid isPermaLink="false">http://www.mikecann.co.uk/?p=1020</guid>
		<description><![CDATA[Twitter can be a funny beast, what makes it great can also make it poor. I use Twhirl which keeps me updated any time one of the people I follow tweets about something, the only problem is that so many people tweet that if I dont happen to see it within about and hour or so of the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://mikecann.co.uk/wp-content/uploads/2010/04/ScreenHunter_01-Apr.-08-20.11.gif"><img class="alignnone size-full wp-image-1023" title="ScreenHunter_01 Apr. 08 20.11" src="http://mikecann.co.uk/wp-content/uploads/2010/04/ScreenHunter_01-Apr.-08-20.11.gif" alt="" width="710" height="164" /></a></p>
<p>Twitter can be a funny beast, what makes it great can also make it poor. I use <a href="http://www.twhirl.org/">Twhirl </a>which keeps me updated any time one of the people I follow tweets about something, the only problem is that so many people tweet that if I dont happen to see it within about and hour or so of the Tweet, ill miss it. This time however I was lucky enough to catch a tweet by <a href="http://twitter.com/joa">@Joa</a> about his new Inversion of Control and functional-programming-like library, <a href="http://code.google.com/p/funk-as3/">Funk AS3</a>.</p>
<p>As I have been getting well into <a href="http://www.robotlegs.org/">RobotLegs</a> (a Dependency Injection MVCS framework) recently I was extremely interested to hear about this new project by Joa who I respect very much as a brilliant coder not least because of his excellent work on low-level Flash byte-code optimisation (see <a href="http://code.google.com/p/apparat/">Apparat</a>).</p>
<p>Joa has taken a different approach to doing dependency injection. The approach most frequently used (and the one used in SwiftSuspenders / RobotLegs) is to use meta-data to declare to a number of variables for injection. You then map a class to be injected and instantiate it using the injector.</p>
<p>As an example, with Swift Suspenders you would define a class for injection with something like the following:</p>
<div id="wpshdo_3" class="wp-synhighlighter-outer"><div id="wpshdt_3" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_3"></a><a id="wpshat_3" class="wp-synhighlighter-title" href="#codesyntax_3"  onClick="javascript:wpsh_toggleBlock(3)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_3" onClick="javascript:wpsh_code(3)" title="Show code only"><img border="0" style="border: 0 none" src="http://mikecann.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_3" onClick="javascript:wpsh_print(3)" title="Print code"><img border="0" style="border: 0 none" src="http://mikecann.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://mikecann.co.uk/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://mikecann.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_3" class="wp-synhighlighter-inner" style="display: block;"><pre class="actionscript3" style="font-family:monospace;"><ol><li class="li1"><div class="de1"><span class="kw4">class</span> MyInjectedClass</div></li><li class="li1"><div class="de1"><span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">	<span class="kw1">public</span> <span class="kw3">function</span> sayHello<span class="br0">&#40;</span>toSay<span class="sy0">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span class="kw5">String</span></a><span class="br0">&#41;</span></div></li><li class="li1"><div class="de1">	<span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">		<span class="kw7">trace</span><span class="br0">&#40;</span><span class="st0">&quot;Hello &quot;</span><span class="sy0">+</span>toStay<span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">	<span class="br0">&#125;</span></div></li><li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1"><span class="kw2">var</span> injector <span class="sy0">:</span> Injector = <span class="kw1">new</span> Injector<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">injector<span class="sy0">.</span>mapSingleton<span class="br0">&#40;</span>MyInjectedClass<span class="br0">&#41;</span><span class="sy0">;</span></div></li></ol></pre></div></div>
<p>Here we are telling the Injector to make a single instance of our class and hold it internally ready for when it is next requested, such as:</p>
<div id="wpshdo_4" class="wp-synhighlighter-outer"><div id="wpshdt_4" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_4"></a><a id="wpshat_4" class="wp-synhighlighter-title" href="#codesyntax_4"  onClick="javascript:wpsh_toggleBlock(4)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_4" onClick="javascript:wpsh_code(4)" title="Show code only"><img border="0" style="border: 0 none" src="http://mikecann.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_4" onClick="javascript:wpsh_print(4)" title="Print code"><img border="0" style="border: 0 none" src="http://mikecann.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://mikecann.co.uk/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://mikecann.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_4" class="wp-synhighlighter-inner" style="display: block;"><pre class="actionscript3" style="font-family:monospace;"><ol><li class="li1"><div class="de1"><span class="kw4">class</span> MyDependantClass</div></li><li class="li1"><div class="de1"><span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">	<span class="br0">&#91;</span>Inject<span class="br0">&#93;</span> <span class="kw1">public</span> <span class="kw2">var</span> myClass <span class="sy0">:</span> MyInjectedClass<span class="sy0">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">	<span class="kw1">public</span> <span class="kw3">function</span> performAction<span class="br0">&#40;</span><span class="br0">&#41;</span></div></li><li class="li1"><div class="de1">	<span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">		myClass<span class="sy0">.</span>sayHello<span class="br0">&#40;</span><span class="st0">&quot;World&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">	<span class="br0">&#125;</span></div></li><li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li></ol></pre></div></div>
<p>Here the [Inject] meta-data indicates that we want the framework to supply the class with an instance of type MyInjectedClass. The final part is to make an instance of the dendant class and inject into it:</p>
<div id="wpshdo_5" class="wp-synhighlighter-outer"><div id="wpshdt_5" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_5"></a><a id="wpshat_5" class="wp-synhighlighter-title" href="#codesyntax_5"  onClick="javascript:wpsh_toggleBlock(5)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_5" onClick="javascript:wpsh_code(5)" title="Show code only"><img border="0" style="border: 0 none" src="http://mikecann.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_5" onClick="javascript:wpsh_print(5)" title="Print code"><img border="0" style="border: 0 none" src="http://mikecann.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://mikecann.co.uk/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://mikecann.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_5" class="wp-synhighlighter-inner" style="display: block;"><pre class="actionscript3" style="font-family:monospace;"><ol><li class="li1"><div class="de1"><span class="kw2">var</span> dependant <span class="sy0">:</span> MyDependantClass = <span class="kw1">new</span> MyDependantClass<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">injector<span class="sy0">.</span>injectInto<span class="br0">&#40;</span>dependant<span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">dependant<span class="sy0">.</span>performAction<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li></ol></pre></div></div>
<p>As you can see this is a nice way of handling inter-module dependencies in your code, when coupled with a MVC framework such as RobotLegs it becomes and extremely powerful yet elegant way of coding.</p>
<p>It however isnt perfect and Joa, on his <a href="http://code.google.com/p/funk-as3/wiki/IoC">google code page</a> mentions three drawbacks of this method:</p>
<ul>
<blockquote>
<li>Your injected properties are publicly exposed and mutable.</li>
<li>describeType is very expensive.</li>
<li>Steep learning curve.</li>
</blockquote>
</ul>
<p>This is where he suggests his alternative method, which is quite ingenious. Using the same example as above you would see something like the following:</p>
<div id="wpshdo_6" class="wp-synhighlighter-outer"><div id="wpshdt_6" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_6"></a><a id="wpshat_6" class="wp-synhighlighter-title" href="#codesyntax_6"  onClick="javascript:wpsh_toggleBlock(6)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_6" onClick="javascript:wpsh_code(6)" title="Show code only"><img border="0" style="border: 0 none" src="http://mikecann.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_6" onClick="javascript:wpsh_print(6)" title="Print code"><img border="0" style="border: 0 none" src="http://mikecann.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://mikecann.co.uk/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://mikecann.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_6" class="wp-synhighlighter-inner" style="display: block;"><pre class="actionscript3" style="font-family:monospace;"><ol><li class="li1"><div class="de1"><span class="kw4">class</span> MyInjectedClass</div></li><li class="li1"><div class="de1"><span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">	<span class="kw1">public</span> <span class="kw3">function</span> sayHello<span class="br0">&#40;</span>toSay<span class="sy0">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span class="kw5">String</span></a><span class="br0">&#41;</span></div></li><li class="li1"><div class="de1">	<span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">		<span class="kw7">trace</span><span class="br0">&#40;</span><span class="st0">&quot;Hello &quot;</span><span class="sy0">+</span>toStay<span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">	<span class="br0">&#125;</span></div></li><li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">bind<span class="br0">&#40;</span>MyInjectedClass<span class="br0">&#41;</span><span class="sy0">.</span>asSingleton<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li></ol></pre></div></div>
<p>Then the dependant class would look like the following:</p>
<div id="wpshdo_7" class="wp-synhighlighter-outer"><div id="wpshdt_7" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_7"></a><a id="wpshat_7" class="wp-synhighlighter-title" href="#codesyntax_7"  onClick="javascript:wpsh_toggleBlock(7)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_7" onClick="javascript:wpsh_code(7)" title="Show code only"><img border="0" style="border: 0 none" src="http://mikecann.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_7" onClick="javascript:wpsh_print(7)" title="Print code"><img border="0" style="border: 0 none" src="http://mikecann.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://mikecann.co.uk/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://mikecann.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_7" class="wp-synhighlighter-inner" style="display: block;"><pre class="actionscript3" style="font-family:monospace;"><ol><li class="li1"><div class="de1"><span class="kw4">class</span> MyInjectedClass</div></li><li class="li1"><div class="de1"><span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">	<span class="kw1">protected</span> <span class="kw2">var</span> myClass <span class="sy0">:</span> MyInjectedClass = inject<span class="br0">&#40;</span>MyInjectedClass<span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">	<span class="kw1">public</span> <span class="kw3">function</span> performAction<span class="br0">&#40;</span><span class="br0">&#41;</span></div></li><li class="li1"><div class="de1">	<span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">		myClass<span class="sy0">.</span>sayHello<span class="br0">&#40;</span><span class="st0">&quot;World&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">	<span class="br0">&#125;</span></div></li><li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li></ol></pre></div></div>
<p>And making an instance of it could be as simple as:</p>
<div id="wpshdo_8" class="wp-synhighlighter-outer"><div id="wpshdt_8" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_8"></a><a id="wpshat_8" class="wp-synhighlighter-title" href="#codesyntax_8"  onClick="javascript:wpsh_toggleBlock(8)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_8" onClick="javascript:wpsh_code(8)" title="Show code only"><img border="0" style="border: 0 none" src="http://mikecann.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_8" onClick="javascript:wpsh_print(8)" title="Print code"><img border="0" style="border: 0 none" src="http://mikecann.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://mikecann.co.uk/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://mikecann.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_8" class="wp-synhighlighter-inner" style="display: block;"><pre class="actionscript3" style="font-family:monospace;"><ol><li class="li1"><div class="de1"><span class="kw2">var</span> dependant <span class="sy0">:</span> MyDependantClass = <span class="kw1">new</span> MyDependantClass<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">dependant<span class="sy0">.</span>performAction<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li></ol></pre></div></div>
<p>As can be seen there are some benefits to this method, the biggest one in my opinion is that injected properties dont have to be public as they are provided by the call from within the class scope rather than from outside.</p>
<p>So how does Joa perform this magic? By abusing a little used ability of the Actionscript programming language known as package-level-functions. These are throwbacks from the old AS1 &amp; AS2 days of global functions. There are actually a couple of common examples in AS3 still such as getTimer() and getQualifiedClassName() still used. What Joa has done is to use these package level functions as a method of generating concise looking code reminiscent of functional programming.</p>
<p>Performance wise, im not entirely sure whether by using package-level functions instead of describeType() calls used in meta-data driven IoC frameworks is any faster as Till Schneidereit of Swift Suspenders suggests:</p>
<blockquote><p>I don&#8217;t think that Funk&#8217;s approach is any faster than an optimized<br />
metadata-based IoC container: describeType may be slow (as in &#8220;takes a<br />
few dozen microseconds to run&#8221;), but is only ever called once for each<br />
class an instance of which is injected into. After that, it&#8217;s just a<br />
straight iteration over an array for all injection points instead of<br />
Funk&#8217;s multiple method calls for each injection point.</p></blockquote>
<p>So the next step for me is to run some tests to see how things pan out. Either way im very impressed with both approaches and cant wait to see what kind of exciting advances will be developed in the coming months.</p>
]]></content:encoded>
			<wfw:commentRss>http://mikecann.co.uk/flash/funk-ioc-a-new-dependency-injection-framework/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>On the Bleeding Edge</title>
		<link>http://mikecann.co.uk/personal-projects/on-the-bleeding-edge/</link>
		<comments>http://mikecann.co.uk/personal-projects/on-the-bleeding-edge/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 22:26:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaFX]]></category>
		<category><![CDATA[Personal Projects]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Inputtie]]></category>
		<category><![CDATA[Java FX]]></category>
		<category><![CDATA[Mate]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Robot Legs]]></category>
		<category><![CDATA[Signals]]></category>

		<guid isPermaLink="false">http://www.mikecann.co.uk/?p=895</guid>
		<description><![CDATA[Well it thought it was about time I did some posting about my personal project im working on at the moment as I havent spoken about my coding for a while. For a while now (alot longer than I had hoped for) I have been working on a project that falls outside the realms of [...]]]></description>
			<content:encoded><![CDATA[<p>Well it thought it was about time I did some posting about my personal project im working on at the moment as I havent spoken about my coding for a while.</p>
<p>For a while now (alot longer than I had hoped for) I have been working on a project that falls outside the realms of my usual kind of games-related projects. Im not ready do describe exactly what it is yet but im excited about it.</p>
<p>For months I have been struggling with the techinal challenges the project has entailed and I have dabbled with many new and highly diverse technologies including <a href="http://www.mikecann.co.uk/programming/flirting-with-javafx/">JavaFX</a> (Java), Qt (C++) and Mono (C#).  I have been looking for a cross-platform technology that will get the job done that I need and doing it in an elegant manner.</p>
<p>I thought I had found it with a combination of JavaFX and straight Java using the PureMVC framework. I however was plagued with problems throughout with Bonjour, jGroups, JmDNS, JNI and JNA.</p>
<p>So after months of work, hardship and struggles I read a very interesting article on the up-and-coming Adobe AIR 2.0  that was opened for beta in December. With 2.0 Adobe are bringing NativeProcess  to Air. What this means is that you can you can execute native code (.dlls, .so, .jar etc) from Air. To me this was bloody brilliant as I had been<a href="http://www.mikecann.co.uk/programming/audiobook-organiser-v1-3-0-dragndrop/"> playing with Air reccently</a> and my <a href="http://www.mikecann.co.uk/photos-personal/playdemic-my-fist-day/">day-job</a> heavily involves Flex and I simply love the power and beauty of Flex.</p>
<p>So what this meant to me was that I could write the bulk of my project including its interface in my much preferred Adobe Flex (Air) and then use Native Process to communicate with a small kernel of Java that would do all the dirty work that Air itself cant do.</p>
<p>So after a little playing with <a href="http://www.riaspace.net/2010/01/flerry-flex-java-bridge-for-adobe-air-2-0/">Flerry</a> for Air-&gt;Java bridge I started to think about the structure of the code and the framework I would use. For my initial few runs at this project I had been using the Java version of PureMVC. I really like some aspects of PureMVC but I think its can be so overly cumbersome in some circumstances (ill write another post on this in the future I think). So instead I looked at the alternatives.</p>
<p>I have been using <a href="http://mate.asfusion.com/">Mate</a> alot recently at work and on my own mini-project the <a href="http://www.mikecann.co.uk/programming/audio-book-organiser-air-mate-flex-4/">Audio Book Organiser</a>. However as this project is partly for my own learning and personal growth I decided to look at what else there was out there. From the videos by <a href="http://www.mikecann.co.uk/fun-videos/jessie-warden-flash-flex-videos/">Jessie Warden</a> I had heard about <a href="http://www.robotlegs.org">Robot Legs</a>. Apparently this framework has been around for a while, but it was the first I had heard of it. Taking at look at it I immediately became very excited as it looks like it offers all the things that make PureMVC great but without the extra coding-baggage that goes with it.</p>
<p>To add to my interest it appears another very interesting, very new action-script technology has been introduced into Robot Legs called <a href="http://github.com/robertpenner/as3-signals">Signals </a>by Robert Penner. Signals is an alternative to the standard events dispatching method found throughout flash (more on this in another post).</p>
<p>So why have I called this post &#8220;the bleeding edge?&#8221;. Well Adobe Air 2.0 is still in beta and has only been for a month or so. Its so new that some parts still havent been documented atall and the only way to find out how they work is to post a msg to the devs on the forums. Signals is also new and its integration into Robot Legs is very new indeed (last coupple of weeks). So at the moment I feel as if im at the forefront of some very new, very exciting technology, a stark contrast to my fiddlings with the ancient Java.</p>
<p>I realise this post is very text and tech-heavy but I needed to post about it before I forgot all the pain I have gone through with this project to get where I am at the moment. Future posts ill be delving a little deeper into some of my experiments with these new technologies <img src='http://mikecann.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://mikecann.co.uk/personal-projects/on-the-bleeding-edge/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>AudioBook Organiser v1.3.0 &#8211; Drag&#039;n&#039;Drop</title>
		<link>http://mikecann.co.uk/personal-projects/audiobook-organiser-v1-3-0-dragndrop/</link>
		<comments>http://mikecann.co.uk/personal-projects/audiobook-organiser-v1-3-0-dragndrop/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 23:07:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Personal Projects]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Audiobook]]></category>
		<category><![CDATA[Drag-Drop]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[iTunes]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Utility]]></category>

		<guid isPermaLink="false">http://www.mikecann.co.uk/?p=856</guid>
		<description><![CDATA[Well I was just doing some audio book organising and realised that it would be great if I could drag and drop a folder straight from my AIR into iTunes ready for upload to my iPhone. Anyways after a little searching through the docs I came up with this little ditty: var cp : Clipboard [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://mikecann.co.uk/wp-content/uploads/2010/01/ScreenHunter_04-Jan.-11-22.36.jpg"><img class="alignnone size-full wp-image-857" title="ScreenHunter_04-Jan.-11-22.36" src="http://mikecann.co.uk/wp-content/uploads/2010/01/ScreenHunter_04-Jan.-11-22.36.jpg" alt="" width="700" height="343" /></a></p>
<p>Well I was just doing some audio book organising and realised that it would be great if I could drag and drop a folder straight from my AIR into iTunes ready for upload to my iPhone.</p>
<p>Anyways after a little searching through the docs I came up with this little ditty:</p>
<pre>var cp : Clipboard = new Clipboard();
cp.setData(ClipboardFormats.FILE_LIST_FORMAT, [new File(book.url)], false);
NativeDragManager.doDrag(null,cp);</pre>
<div>Which gets fired by my DataGrid in the view:</div>
<pre>
<div>&lt;mx:DataGrid width="100%" height="100%" dataProvider="{books}" editable="true"</div>
<div>  itemEditEnd="{dispatchEvent(new BooksEvent(BooksEvent.PROPERTY_CHANGED));}"</div>
<div>  dragEnabled="true"</div>
<div>  dragStart="{dispatchEvent(new BooksEvent(BooksEvent.BOOK_BEGIN_DRAG, AudioBookModel(event.currentTarget.selectedItem)))}"&gt;</div>
</pre>
<div>Its pretty cool.</div>
<div>Anyways, the latest version and the source is below:</div>
<div>
<p><div id="flashcontent2940" style="width:215px; height:180px;"><strong>Please upgrade your Flash Player</strong> This is the content that would be shown if the user does not have Flash Player 9.0.115 or higher installed.</div><script type="text/javascript">
<!-- // <![CDATA[
var so = new SWFObject("http://mikecann.co.uk/wp-content/plugins/air-badge/AIRInstallBadge.swf", "Badge", "215", "180", "9.0.115", "#FFFFFF");
so.useExpressInstall("http://mikecann.co.uk/wp-content/plugins/air-badge/expressinstall.swf");
so.addVariable("airversion", "1.0");
so.addVariable("appname", "Audio+Book+Orgainser");
so.addVariable("appurl", "http://www.mikecann.co.uk/flash/AudioBookOrganiser/AudioBookOrganiser.air");
so.addVariable("appid", "Audio+Book+Orgainser");
so.addVariable("pubid", "");
so.addVariable("appversion", "1");
so.addVariable("imageurl", "http://www.mikecann.co.uk/flash/AudioBookOrganiser/badgeImg.jpg");
so.addVariable("appinstallarg", "installed from web");
so.addVariable("applauncharg", "launched from web");
so.addVariable("helpurl", "help.html");
so.addVariable("hidehelp", "true");
so.addVariable("skiptransition", "false");
so.addVariable("titlecolor", "#00AAFF");
so.addVariable("buttonlabelcolor", "#00AAFF");
so.addVariable("appnamecolor", "#00AAFF");
so.addVariable("str_err_airswf", "<u>Running locally?</u><br/><br/>The AIR proxy swf won't load properly when this is run from the local file system.");
so.write("flashcontent2940");
// ]]&gt; -->
</script>
<br />
Source: <a href="http://www.mikecann.co.uk/flash/AudioBookOrganiser/AudioBookOrganiser_v130_source.zip">http://www.mikecann.co.uk/flash/AudioBookOrganiser/AudioBookOrganiser_v130_source.zip</a></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://mikecann.co.uk/personal-projects/audiobook-organiser-v1-3-0-dragndrop/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quasimondo&#039;s Galactose</title>
		<link>http://mikecann.co.uk/programming/actionscript/quasimondos-galactose/</link>
		<comments>http://mikecann.co.uk/programming/actionscript/quasimondos-galactose/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 20:17:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Experiment]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Lab]]></category>
		<category><![CDATA[Particles]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.mikecann.co.uk/?p=830</guid>
		<description><![CDATA[I have immense respect for some of the flash developers out there and Quasimondo is one of them. He has just released a little particle related experiment. Whenever I see these kind of things it inspires me to bash out my own little experiments. I wont talk too much about it but check it out [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://mikecann.co.uk/wp-content/uploads/2010/01/ScreenHunter_02-Jan.-10-20.13.jpg"><img class="alignnone size-full wp-image-831" title="ScreenHunter_02 Jan. 10 20.13" src="http://mikecann.co.uk/wp-content/uploads/2010/01/ScreenHunter_02-Jan.-10-20.13.jpg" alt="ScreenHunter_02 Jan. 10 20.13" width="688" height="365" /></a></p>
<p>I have immense respect for some of the flash developers out there and Quasimondo is one of them. He has just released a little particle related experiment.</p>
<p>Whenever I see these kind of things it inspires me to bash out my own little experiments.</p>
<p>I wont talk too much about it but check it out on this lab page: <a href="http://incubator.quasimondo.com/flash/galactose.php">http://incubator.quasimondo.com/flash/galactose.php</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mikecann.co.uk/programming/actionscript/quasimondos-galactose/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Audio Book Organiser v1.2.0</title>
		<link>http://mikecann.co.uk/personal-projects/audio-book-organiser-v1-2-0/</link>
		<comments>http://mikecann.co.uk/personal-projects/audio-book-organiser-v1-2-0/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 18:37:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Personal Projects]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Audiobook]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[Mate]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Utility]]></category>

		<guid isPermaLink="false">http://www.mikecann.co.uk/?p=826</guid>
		<description><![CDATA[Just did a quick update to the audio book organiser. Added the ability to move the storage database file. This was so that I can put my storage file on Dropbox and it will then be backedup and synced between machines. New version and sources: Please upgrade your Flash Player This is the content that [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://mikecann.co.uk/wp-content/uploads/2010/01/ScreenHunter_01-Jan.-09-18.34.jpg"><img class="alignnone size-full wp-image-827" title="ScreenHunter_01 Jan. 09 18.34" src="http://mikecann.co.uk/wp-content/uploads/2010/01/ScreenHunter_01-Jan.-09-18.34.jpg" alt="ScreenHunter_01 Jan. 09 18.34" width="605" height="359" /></a></p>
<p>Just did a quick update to the audio book organiser. Added the ability to move the storage database file. This was so that I can put my storage file on Dropbox and it will then be backedup and synced between machines.</p>
<p>New version and sources:</p>
<p style="text-align: center;"><div id="flashcontent2840" style="width:215px; height:180px;"><strong>Please upgrade your Flash Player</strong> This is the content that would be shown if the user does not have Flash Player 9.0.115 or higher installed.</div><script type="text/javascript">
<!-- // <![CDATA[
var so = new SWFObject("http://mikecann.co.uk/wp-content/plugins/air-badge/AIRInstallBadge.swf", "Badge", "215", "180", "9.0.115", "#FFFFFF");
so.useExpressInstall("http://mikecann.co.uk/wp-content/plugins/air-badge/expressinstall.swf");
so.addVariable("airversion", "1.0");
so.addVariable("appname", "Audio+Book+Orgainser");
so.addVariable("appurl", "http://www.mikecann.co.uk/flash/AudioBookOrganiser/AudioBookOrganiser.air");
so.addVariable("appid", "Audio+Book+Orgainser");
so.addVariable("pubid", "");
so.addVariable("appversion", "1");
so.addVariable("imageurl", "http://www.mikecann.co.uk/flash/AudioBookOrganiser/badgeImg.jpg");
so.addVariable("appinstallarg", "installed from web");
so.addVariable("applauncharg", "launched from web");
so.addVariable("helpurl", "help.html");
so.addVariable("hidehelp", "true");
so.addVariable("skiptransition", "false");
so.addVariable("titlecolor", "#00AAFF");
so.addVariable("buttonlabelcolor", "#00AAFF");
so.addVariable("appnamecolor", "#00AAFF");
so.addVariable("str_err_airswf", "<u>Running locally?</u><br/><br/>The AIR proxy swf won't load properly when this is run from the local file system.");
so.write("flashcontent2840");
// ]]&gt; -->
</script>
</p>
<p style="text-align: center;">
<p>Source: <a href="http://www.mikecann.co.uk/flash/AudioBookOrganiser/AudioBookOrganiser_v120_source.zip">http://www.mikecann.co.uk/flash/AudioBookOrganiser/AudioBookOrganiser_v120_source.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mikecann.co.uk/personal-projects/audio-book-organiser-v1-2-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

