<?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>Lost In Actionscript - Shane McCartney &#187; Source</title>
	<atom:link href="http://www.lostinactionscript.com/blog/index.php/category/source/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lostinactionscript.com/blog</link>
	<description>Lost In Actionscript</description>
	<lastBuildDate>Sat, 06 Mar 2010 04:03:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>AES Cryptography for Actionscript &amp; PHP</title>
		<link>http://www.lostinactionscript.com/blog/index.php/2009/11/29/aes-cryptography-for-actionscript-php/</link>
		<comments>http://www.lostinactionscript.com/blog/index.php/2009/11/29/aes-cryptography-for-actionscript-php/#comments</comments>
		<pubDate>Sat, 28 Nov 2009 21:32:36 +0000</pubDate>
		<dc:creator>Shane McCartney</dc:creator>
				<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://www.lostinactionscript.com/blog/?p=296</guid>
		<description><![CDATA[Over the last couple of years I have used encryption on many Flash projects and until the other day, this was always a straight forward task. Cryptography has been particularly useful when to protect a server side script from fraudulent attacks. This has included things like a high score board or the progress of players [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.lostinactionscript.com/blog/wp-content/uploads/2009/11/enigma.jpg" alt="enigma" title="enigma" width="300" height="300" class="alignnone size-full wp-image-302" />Over the last couple of years I have used encryption on many Flash projects and until the other day, this was always a straight forward task. Cryptography has been particularly useful when to protect a server side script from fraudulent attacks. This has included things like a high score board or the progress of players through out a game.</p>
<p>In the past I had always used <a href="http://code.google.com/p/as3crypto/">Hurlant's crypto library</a> which has quite a few cryptography options and includes my favorite algorithm AES. <strong>A</strong>dvanced <strong>E</strong>ncryption <strong>S</strong>tandard is a quite secure cryptography solution and is supposedly the exact same level of encryption used by American Government's NSA. I am not a server side guy typically but I can code C#. The nice thing about C# and AES when transacting to and from Flash is it works perfectly. PHP unfortunately does not have an official cryptography package, but thankfully there are many efforts to support this cryptography algorithm from within the community. This might sound OK, but the problem we had with this is Hurlant's AS3 cryptography library doesn't seem to be able to interface with the PHP AES options we tried (though it seems to work fine with other languages like C#). We did put in a good hour or so trying several mode, pad and encoding options - no dice. After a quick Google on this issue because usually if you are facing a weird issue there's a damn good chance others have faced it already. So Google revealed to us this is a common problem and I was told maybe it's better to find an alternative cryptographic solution. Me being, well me :) I don't like being beaten on any technical challenge. During my Google link travels I came across this great <a href="http://www.movable-type.co.uk/scripts/aes.html">Javascript implementation</a> of AES which also has a PHP option. Knowing that Javascript and Actionscript fall under the same standards. I figured rather than find using a different encryption option which is less secure. I quickly ported the Javascript code to Actionscript which took about 15 mins and funnily this post took much longer than this to write :)</p>
<h3>Actionscript AES Encryption</h3>
<p>So here is a simple example demo with just pure Actionscript AES encryption and decryption with a block cipher of 256 bits.<br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_AES_1256490737"
			class="flashmovie"
			width="550"
			height="180">
	<param name="movie" value="http://www.flashdynamix.com/examples/AES/SWFLoader.swf?url= http://www.flashdynamix.com/examples/AES/AES.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.flashdynamix.com/examples/AES/SWFLoader.swf?url= http://www.flashdynamix.com/examples/AES/AES.swf"
			name="fm_AES_1256490737"
			width="550"
			height="180">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<h3>PHP AES Encryption from Flash</h3>
<p>And here is another example demonstrating Actionscript to <a href="http://www.movable-type.co.uk/scripts/aes-php.html">PHP</a> AES encryption and decryption with the same block cipher of 256 bits. Both demonstrations use the same key so if you change the keys so they do not match then they will not be able to decrypt between each other. Also in this demonstration I post the key with the text to either encrypt or decrypt, you would of course never do this when using AES normally.<br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_AES-PHP_557895966"
			class="flashmovie"
			width="550"
			height="180">
	<param name="movie" value="http://www.flashdynamix.com/examples/AES/SWFLoader.swf?url= http://www.flashdynamix.com/examples/AES/AES-PHP.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.flashdynamix.com/examples/AES/SWFLoader.swf?url= http://www.flashdynamix.com/examples/AES/AES-PHP.swf"
			name="fm_AES-PHP_557895966"
			width="550"
			height="180">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>I hope this is sunshine on a rainny day for someone out there, you can download the source code from the Lost In Actionscript <a href="http://lostinactionscript.googlecode.com/svn/trunk/">code.google repository</a> or <a href="http://lostinactionscript.googlecode.com/files/AES.zip">download an archived version</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lostinactionscript.com/blog/index.php/2009/11/29/aes-cryptography-for-actionscript-php/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Custom blend modes for Flash 10</title>
		<link>http://www.lostinactionscript.com/blog/index.php/2009/05/26/custom-blend-modes-for-flash-10/</link>
		<comments>http://www.lostinactionscript.com/blog/index.php/2009/05/26/custom-blend-modes-for-flash-10/#comments</comments>
		<pubDate>Mon, 25 May 2009 22:58:46 +0000</pubDate>
		<dc:creator>Shane McCartney</dc:creator>
				<category><![CDATA[Interesting]]></category>
		<category><![CDATA[Play]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://www.lostinactionscript.com/blog/?p=256</guid>
		<description><![CDATA[In the last few months I have been working on a collection of blendmodes for Flash 10 which extend the limited set of blendmodes currently and inconsistently supplied by Adobe applications. This can help to achieve all kinds of motion effects which I won't go into detail here but if you know a little about [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-medium wp-image-257" title="chameleon" src="http://www.lostinactionscript.com/blog/wp-content/uploads/2009/05/chameleon-300x224.jpg" alt="chameleon" width="300" height="224" />In the last few months I have been working on a collection of blendmodes for Flash 10 which extend the limited set of blendmodes currently and inconsistently supplied by Adobe applications. This can help to achieve all kinds of motion effects which I won't go into detail here but if you know a little about After Effects you will know that some of these are rather exciting.</p>
<p>If you are familiar with the Adobe product line there is inconsistency between Photoshop/Illustrator/Flash/Fireworks/InDesign and support for various subsets of blendmodes which is rather annoying especially for us Flash guys. This project overzealously named the 'Ultimate Blend Mode Collection' is an attempt to standardize this unofficially on Adobes behalf. So marrying up Photoshop designs and Flash layouts with unsupported blendmodes won't be nearly as annoying as has been previously. Further to this, these custom blendmodes allow for control to exaggerate and undo the blendmode effects. What this means is you do not have to double up the blendmode effect by duplicating the DisplayObject instance with the same blendmode you can just multiply the single blendmode effect - simple and quite effecient.</p>
<p>So far I have completed the following custom blend modes :</p>
<ul>
<li>Add</li>
<li>Hard Mix</li>
<li>Hardlight</li>
<li>Glow</li>
<li>Subtract</li>
<li>Stencil Luma</li>
<li>Extrapolate</li>
<li>Difference</li>
<li>Average</li>
<li>Lighter Color</li>
<li>Lighten</li>
<li>Color Dodge</li>
<li>Stencil Alpha</li>
<li>Stamp</li>
<li>Softlight</li>
<li>Silhouette Luma</li>
<li>Silhouette Alpha</li>
<li>Screen</li>
<li>PinLight</li>
<li>Phoenix</li>
<li>Overlay</li>
<li>Negation</li>
<li>Multiply</li>
<li>Linear Light</li>
<li>Linear Dodge</li>
<li>Linear Burn</li>
<li>Darken</li>
<li>Desaturate</li>
<li>Exclusion</li>
<li>Color Burn</li>
<li>Alpha</li>
<li>Darker Color</li>
</ul>
<p>These are working though have issues of dirty-ness on alpha channels (explained below) for blending layers :</p>
<ul>
<li>Reflect</li>
<li>Freeze</li>
<li>Heat</li>
<li>Vivid Light</li>
</ul>
<p>These custom blend modes are currently in development :</p>
<ul>
<li>Color</li>
<li>Hue</li>
<li>Luminosity</li>
<li>Saturation</li>
<li>Dissolve</li>
</ul>
<h3>How to use custom blend modes</h3>
<p>I have only provided a method to use these custom blend modes included with the 'Ultimate Blendmode Collection' for Flex and CS4 users. This is because the PBJ files are compiled into a SWC so you will need to be able to reference SWCs from your FLA or SWF compiler to use the custom blend modes I have mentioned. The syntax to apply a custom blend mode can be achieved via any of the following approaches :</p>
<pre class="actionscript"><span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">BlendModeShader</span>;
&nbsp;
myDisplayObject.<span style="color: #006600;">blendShader</span> = BlendModeShader.<span style="color: #006600;">SOFTLIGHT</span>;</pre>
<p>or
<pre class="actionscript">&nbsp;
<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">BlendModeShader</span>;
<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">shaders</span>.<span style="color: #006600;">*</span>;
&nbsp;
myDisplayObject.<span style="color: #006600;">blendShader</span> = <span style="color: #0006ff; font-weight: bold;">new</span> BlendModeSoftlight<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</pre>
<p>or you can manipulate the shader </p>
<pre class="actionscript"><span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">BlendModeShader</span>;
<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">shaders</span>.<span style="color: #006600;">*</span>;
&nbsp;
<span style="color: #0006ff; font-weight: bold;">var</span> customBlendMode: BlendModeSoftlight  = <span style="color: #0006ff; font-weight: bold;">new</span> BlendModeSoftlight<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
customBlendMode.<span style="color: #006600;">multiply</span> = <span style="color: #cc66cc;">2</span>;
customBlendMode.<span style="color: #006600;">alpha</span> = <span style="color: #cc66cc;">0.5</span>;
myDisplayObject.<span style="color: #006600;">blendShader</span> = customBlendMode;</pre>
<h3>Tips for writing your own custom blend modes</h3>
<p>Here are some potentially huge gotchas and lovely time savers for those wanna be pixel shader writers (like myself) :</p>
<ol>
<li>Un-multiply alpha before carrying out your shader algorithm. You might already know that Flash pre-multiplies the alpha channel onto the rgb channels this means that if you want to know what the actual rgb components are you will need to do the following :
<pre class="actionscript"><span style="color: #0066CC;">void</span>
evaluatePixel<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
       	float2 uv = outCoord<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
       	float4 src1Rgba = sampleLinear<span style="color: #66cc66;">&#40;</span>src1, uv<span style="color: #66cc66;">&#41;</span>;
        float src1Alpha = src1Rgba.<span style="color: #006600;">a</span>;
        <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>src1Alpha&gt;<span style="color: #cc66cc;">0.0</span><span style="color: #66cc66;">&#41;</span> src1Rgba.<span style="color: #006600;">rgb</span> *= <span style="color: #cc66cc;">1.0</span>/src1Alpha; <span style="color: #808080; font-style: italic;">//This line un-multiplies the alpha from the rgb channels</span>
<span style="color: #66cc66;">&#125;</span></pre>
</li>
<li>When your done manipulating your blending layer against the base layer it's more than likely you will need to composite your new blending layer and base layers together while preserving the alpha components. The following should be useful for this :
<pre class="actionscript"><span style="color: #0066CC;">void</span>
evaluatePixel<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
       	......
&nbsp;
        <span style="color: #006600;">interpolateAlpha</span> = src2Rgba.<span style="color: #006600;">a</span>;
        inverseAlpha = <span style="color: #cc66cc;">1.0</span>-interpolateAlpha;
&nbsp;
        dst.<span style="color: #006600;">rgb</span> = src2Rgba.<span style="color: #006600;">rgb</span>+src1Rgba.<span style="color: #006600;">rgb*inverseAlpha</span>;
        dst.<span style="color: #006600;">a</span> = <span style="color: #0066CC;">min</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1.0</span>, src1Alpha+src2Alpha<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre>
</li>
<li>Make sure you clamp the components you are altering between 0.0 and 1.0 outside these will give you unusual results between tests made with the Pixel Bender Toolkit and from a published Flash movie. This bit of code ought to fix this :
<pre class="actionscript"><span style="color: #0066CC;">void</span>
evaluatePixel<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
       	float3 minRgb = float3<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0.0</span>, <span style="color: #cc66cc;">0.0</span>, <span style="color: #cc66cc;">0.0</span><span style="color: #66cc66;">&#41;</span>;
        float3 maxRgb = float3<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1.0</span>, <span style="color: #cc66cc;">1.0</span>, <span style="color: #cc66cc;">1.0</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
        ......
&nbsp;
        <span style="color: #006600;">dst</span>.<span style="color: #006600;">rgb</span> = clamp<span style="color: #66cc66;">&#40;</span>dst.<span style="color: #006600;">rgb</span>, minRgb, maxRgb<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre>
</li>
<li>Because Flash premultiplies alpha and I explained earlier about why you may need to un-multiply alpha from the rgb components. It's important to know from this there is a certain degree of losiness and this article by <a href="http://www.quasimondo.com/archives/000665.php#000665">Mario</a> is a great Actionscript explanation (completely unrelated to shaders) of this and is one among many others crying out for help (like me). You may notice in the example below which demonstrates these custom blend modes (or in your own tests) a certain degree of image dirty-ness and this dirty-ness is due to this. I am still working on a way to reduce or get around this - any ideas are certainly welcome - and I've highlighted the shaders above most affected by this.</li>
<li>When applying a shader the input sources for the blending and base layer are automatically set. This is great but doesn't allow for setting any further image4 inputs. From my tests if I do try to do this then the Flash Player crashes every time. This is bug and generally bugging me because I can't complete other custom blendmodes based on random math like the Dissolve blendmode</li>
</ol>
<h3>How to get the custom blend modes</h3>
<p>I have placed my PBJ, PBK and SWC files on a <a href="http://code.google.com/p/blendmodes4flash/">code.google</a> project. I have also put together a brief <a href="http://code.google.com/p/blendmodes4flash/wiki/GettingStarted">getting started</a> page.  If you want to get an idea of what's possible using these custom blend modes the simple example below should help to demonstrate this. Also make sure you try out a few of the various base and blending layers I have set up to see what does what.</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_UltimateBlendModeCollection_847055586"
			class="flashmovie"
			width="550"
			height="920">
	<param name="movie" value="http://www.flashdynamix.com/examples/Blendmodes4Flash/SWFLoader.swf?url= http://www.flashdynamix.com/examples/Blendmodes4Flash/UltimateBlendModeCollection.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.flashdynamix.com/examples/Blendmodes4Flash/SWFLoader.swf?url= http://www.flashdynamix.com/examples/Blendmodes4Flash/UltimateBlendModeCollection.swf"
			name="fm_UltimateBlendModeCollection_847055586"
			width="550"
			height="920">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<h3>References</h3>
<p>If you are interested in writing your own blend modes I used quite a few sources in order to collect the algorithms used in the examples seen above - here are the main sources :<br />
<a href="http://www.pegtop.net/delphi/articles/blendmodes/">http://www.pegtop.net/delphi/articles/blendmodes/</a><br />
<a href="http://blog.mouaif.org/?p=94">http://blog.mouaif.org/?p=94</a><br />
<a href="http://www.nathanm.com/photoshop-blending-math/">http://www.nathanm.com/photoshop-blending-math/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lostinactionscript.com/blog/index.php/2009/05/26/custom-blend-modes-for-flash-10/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Export Layers to SWF with JSFL</title>
		<link>http://www.lostinactionscript.com/blog/index.php/2009/04/03/export-layers-to-swf-with-jsfl/</link>
		<comments>http://www.lostinactionscript.com/blog/index.php/2009/04/03/export-layers-to-swf-with-jsfl/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 00:42:19 +0000</pubDate>
		<dc:creator>Shane McCartney</dc:creator>
				<category><![CDATA[Interesting]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://www.lostinactionscript.com/blog/?p=232</guid>
		<description><![CDATA[It's embarrassing but until the other week I hadn't a reason to do anything (beyond tinkering) with JSFL. JSFL can be especially useful for simplifying or automating tasks in the Flash IDE and that isn't breaking news. I think I understand why I haven't been using JSFL too much until recently. The major problem I [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-medium wp-image-234" title="jsfl" src="http://www.lostinactionscript.com/blog/wp-content/uploads/2009/04/jsfl-300x300.jpg" alt="jsfl" width="300" height="300" />It's embarrassing but until the other week I hadn't a reason to do anything (beyond tinkering) with JSFL. JSFL can be especially useful for simplifying or automating tasks in the Flash IDE and that isn't breaking news. I think I understand why I haven't been using JSFL too much until recently. The major problem I discovered is the documentation is very poor, if you search JSFL you get exactly <a href="http://help.adobe.com/en_US/Flash/10.0_UsingFlash/search.html?gsa=1&amp;q=JSFL">diddly squat</a> on how to use JSFL. And alas Googling JSFL aint much better with the term "JSFL Reference" the only adobe link is <a href="http://livedocs.adobe.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/js/html/wwhelp.htm?href=Part_JSAPI.html">this one</a>. Considering this help reference is 5 years old doesn't inflate confidence in learning the latest and greatest JSFL has to offer - this is really pathetic Adobe. If someone can find an official decent resource on JSFL it would be appreciated, SURELY that isn't it :) <del datetime="2009-04-08T14:50:43+00:00">So despite not being able to find a great JSFL reference</del> Eventually I was referred to this <a href="http://help.adobe.com/en_US/Flash/10.0_ExtendingFlash/index.html">great JSFL reference</a>. The JSFL script I needed to write was really quite basic and for Actionscript developers writing JSFL it is very familiar territory so I was somehow blindly confident.</p>
<p>So I will describe the usefulness of this JSFL script by first explaining the task or problem at hand it solved for me and hopefully you find it useful also.</p>
<h1>The Problem</h1>
<p>I had a rather complex vector map (12 MB) in a SWF. Embedding the whole map would be obviously be a BAD idea for loading times but fortunately only very small portions of this map had to be used at any time. Though the suker punch to this idea is that the map isn't grouped to these portions - sigh.</p>
<h1>The Solution</h1>
<p>So I started with some unavoidable and rather laborious instance naming grinding which I did within Flash. Once I had completed this I had literally 100's of Movieclips associated to Classes that needed to be published and when I hit this I  realised - JSFL I love you! So I distributed these MovieClips to layers then ran this script and viola all the layers are published as swfs using the layer name as the published SWF name - ba da boom ching :)</p>
<p>The way this script works is that publishes any layer that isn't a folder or a guide on the main timeline. Then sets all the layers to guides, then loops through the layers desired to be outputted to SWF then changes them to a normal layer so that only this layer is the only one in the published SWF. Once the publish loop is completed all layers are then set back to their original states.</p>
<p>Rather simple I thought and a huge time saver for mindless SWF publishing. To run this JSFL simply double click it or drag it onto Flash then you will be prompted to select the output directory. Then sit back, relax or even take the evening off and tell your project manager you're hard at work!</p>
<p>You can <a href="http://code.google.com/p/lostinactionscript/source/browse/trunk/jsfl/Export%20Layers%20As%20SWFs.jsfl">view the source</a> or <a href="http://lostinactionscript.googlecode.com/files/Export%20Layers%20As%20SWFs.zip">download this script here</a> - get it while it's hot!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lostinactionscript.com/blog/index.php/2009/04/03/export-layers-to-swf-with-jsfl/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Compiling Shader SWCs with ANT build-files</title>
		<link>http://www.lostinactionscript.com/blog/index.php/2009/02/25/compiling-shader-swcs-with-ant-build-files/</link>
		<comments>http://www.lostinactionscript.com/blog/index.php/2009/02/25/compiling-shader-swcs-with-ant-build-files/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 23:14:19 +0000</pubDate>
		<dc:creator>Shane McCartney</dc:creator>
				<category><![CDATA[Interesting]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://www.lostinactionscript.com/blog/?p=182</guid>
		<description><![CDATA[In my talk I briefly introduced the concept of using Flex to compile to a SWC containing Shaders. If you've used Shaders it's rather annoying you have to load in an exported Shader .pbj file at runtime before you can use a Shader. I really like the idea of having my shaders in a SWC [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.lostinactionscript.com/blog/wp-content/uploads/2009/02/ant-activities-5-300x220.jpg" alt="Cool Ant" title="Cool Ant" width="300" height="220" class="alignnone size-medium wp-image-193" />In my talk I briefly introduced the concept of using Flex to compile to a SWC containing Shaders. If you've used Shaders it's rather annoying you have to load in an exported Shader .pbj file at runtime before you can use a Shader. I really like the idea of having my shaders in a SWC to get around this problem. But this is also useful as a means to distribute your Shaders especially for the Shaders I use often like custom blendModes and some filter effects.</p>
<p>I usually compile SWCs via an ANT buildfile in Eclipse and I will provide this handy script to you as open source code. I like using ANT because it makes it very easy for me to automate the task of creating SWCs then even carrying out other tasks like FTPing. </p>
<p>As well as compiling SWCs and SWFs using ANT I also often publish documentation using these build-files and as my FITC talk briefly covered Javadoc in regard to 'coding conventions' I will also include the source code for how to convert your <a href="http://java.sun.com/j2se/javadoc/writingdoccomments/">Javadoc notation</a> to HTML documentation using Flex with asdoc via an ANT build-file.</p>
<p>But before you use these ANT build-files it's important to mention you will need to setup up the appropriate .prefs file to match particular variables to your system.</p>
<p>Here is an example which demonstrates the .prefs file for the SWC ANT build-file</p>
<pre>
compc 		=/Applications/Flex SDK 4/bin/compc
src    		=/classes
outputFile 	=/swc/TheSWC.swc
</pre>
<p>Here is the code you may like to use as a reference to compiling your Shader files into a swc</p>
<pre class="actionscript">&nbsp;
package <span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Shader</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">utils</span>.<span style="color: #006600;">ByteArray</span>;	
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #0006ff; font-weight: bold;">class</span> Shaders <span style="color: #66cc66;">&#123;</span>
&nbsp;
		<span style="color: #66cc66;">&#91;</span>Embed<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;RippleTransition.pbj&quot;</span>, mimeType=<span style="color: #ff0000;">&quot;application/octet-stream&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>
		<span style="color: #0066CC;">private</span> <span style="color: #0066CC;">static</span> <span style="color: #0006ff; font-weight: bold;">var</span> RippleTransitionData : <span style="color: #0006ff; font-weight: bold;">Class</span>;
&nbsp;
		<span style="color: #66cc66;">&#91;</span>Embed<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Bloom.pbj&quot;</span>, mimeType=<span style="color: #ff0000;">&quot;application/octet-stream&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>
		<span style="color: #0066CC;">private</span> <span style="color: #0066CC;">static</span> <span style="color: #0006ff; font-weight: bold;">var</span> BloomData : <span style="color: #0006ff; font-weight: bold;">Class</span>;
&nbsp;
		<span style="color: #66cc66;">&#91;</span>Embed<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;BlendModeSoftlight.pbj&quot;</span>, mimeType=<span style="color: #ff0000;">&quot;application/octet-stream&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>
		<span style="color: #0066CC;">private</span> <span style="color: #0066CC;">static</span> <span style="color: #0006ff; font-weight: bold;">var</span> SoftLightBlendModeData : <span style="color: #0006ff; font-weight: bold;">Class</span>;
&nbsp;
		<span style="color: #808080; font-style: italic;">// Transitions</span>
		<span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> <span style="color: #0006ff; font-weight: bold;">var</span> rippleTransition : Shader;
&nbsp;
		<span style="color: #808080; font-style: italic;">//Lighting</span>
		<span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> <span style="color: #0006ff; font-weight: bold;">var</span> bloom : Shader;
&nbsp;
		<span style="color: #808080; font-style: italic;">//BlendModes</span>
		<span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> <span style="color: #0006ff; font-weight: bold;">var</span> softLightBlendMode : Shader;
&nbsp;
		protected <span style="color: #0066CC;">static</span> <span style="color: #0006ff; font-weight: bold;">var</span> inited : <span style="color: #0066CC;">Boolean</span> = init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #0066CC;">static</span> <span style="color: #0006ff; font-weight: bold;">function</span> init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">Boolean</span> <span style="color: #66cc66;">&#123;</span>
			rippleTransition = <span style="color: #0006ff; font-weight: bold;">new</span> Shader<span style="color: #66cc66;">&#40;</span><span style="color: #0006ff; font-weight: bold;">new</span> RippleTransitionData<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> as ByteArray<span style="color: #66cc66;">&#41;</span>;
&nbsp;
			bloom = <span style="color: #0006ff; font-weight: bold;">new</span> Shader<span style="color: #66cc66;">&#40;</span><span style="color: #0006ff; font-weight: bold;">new</span> BloomData<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> as ByteArray<span style="color: #66cc66;">&#41;</span>;
&nbsp;
			softLightBlendMode = <span style="color: #0006ff; font-weight: bold;">new</span> Shader<span style="color: #66cc66;">&#40;</span><span style="color: #0006ff; font-weight: bold;">new</span> SoftLightBlendModeData<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> as ByteArray<span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #b1b100;">return</span> <span style="color: #0006ff; font-weight: bold;">true</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;</pre>
<p>Download the <a href="http://www.flashdynamix.com/downloads/Ant_SWC_AsDoc.zip">handy ANT buildfiles here</a></p>
<p>If you are interested in writing your own ANT build files read up about this <a href="http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.platform.doc.user/gettingStarted/qs-81_basics.htm">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lostinactionscript.com/blog/index.php/2009/02/25/compiling-shader-swcs-with-ant-build-files/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tweensy goes public</title>
		<link>http://www.lostinactionscript.com/blog/index.php/2009/01/05/tweensy-goes-public/</link>
		<comments>http://www.lostinactionscript.com/blog/index.php/2009/01/05/tweensy-goes-public/#comments</comments>
		<pubDate>Sun, 04 Jan 2009 23:20:34 +0000</pubDate>
		<dc:creator>Shane McCartney</dc:creator>
				<category><![CDATA[Interesting]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://www.lostinactionscript.com/blog/?p=125</guid>
		<description><![CDATA[I know it's late but better late than never, Tweensy just turned 0.2 and is now available as a public beta. In this release Tweensy has been split into the 2 flavors Zero and Original and has an expansion FX package.
I've been spending quite a while tightening all the bolts in Tweensy and to get [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.flashdynamix.com/blog/wp-content/uploads/2008/08/tweensy.jpg" alt="" />I know it's late but better late than never, Tweensy just turned 0.2 and is now available as a public beta. In this release Tweensy has been split into the 2 flavors Zero and Original and has an expansion FX package.</p>
<p>I've been spending quite a while tightening all the bolts in Tweensy and to get it as efficient and feature packed as possible and its paid off. I've managed to get Tweensy to run <a href="http://www.flashdynamix.com/examples/Tweensy/0.2/SuperRenderTweenTest.html">much faster</a> than the previous fastest AS3 Tween engine which was TweenLite/TweenMax - wowzas! </p>
<p>Tweensy gets this performance boost compared to other tween engines because #1 it's type safe, has an option to use <a href="http://www.lostinactionscript.com/blog/index.php/2008/10/30/object-pooling-in-as3/">Object Pooling</a> and utilizes a <a href="http://en.wikipedia.org/wiki/Linked_list">DoubleLinked list</a> rather than a Dictionary or Array. The final method you can use for speed improvement in Tweensy is by rendering through a BitmapLayer using TweensyFX which circumnavigates the DisplayList and this most often provides a higher frame rate at the penalty of using more RAM - but I think that's acceptable. </p>
<p>Tweensy is type safe due to a collection of tween plugins which allow for targetting  commonly tweened Objects such as MovieClip, DisplayObjects, ColorTransforms etc. This means creating new plugins for example Papervision's DisplayObject3D very easy,  so DisplayObject3D could benefit from the performance of Tweensy property tweening as well. But regardless of this a fallback plugin allows for Tweensy to tween any public property for any Object.</p>
<p>But don't think Tweensy is just an efficient tween engine it's also feature packed to rival (or beat in my opinion) any other AS3 tween engine available today. And anything it doesn't fulfill feel free to <a href="http://code.google.com/p/tweensy/issues/list">feature request it</a>. I've taken some time to write up a wiki page to help users <a href="http://code.google.com/p/tweensy/wiki/GettingStarted">get started</a>. As well every method and class is commented so you should be able to use the <a href="http://docs.flashdynamix.com/tweensy/fx/">documentation</a> files to find out exactly what's contained within Tweensy library very easily. But if you're new to using a tween library I recommend you to read the getting started wiki page.</p>
<p>Not only is Tweensy feature packed and more efficient than other tween engines, TweensyZero weighs in at about 2.9KB making it an ideal product to use in banners - where every KB counts.</p>
<p>Tweensy also allows for tweening along <a href="http://code.google.com/p/tweensy/wiki/MotionGuides">complicated motion guides</a> otherwise known as bezier curves. One thing that particularly annoyed me while using other tween engines is that the algorithim used for tweening a bezier curve resulted in the DisplayObject accelerating and decelerating as the curve distance  increased and decreased. All completely regardless of the ease equation used! You'll get no such problem with Tweensy which gives precise control over tweening on a bezier curve. Other motion guides included in Tweensy include direction and orbit which are cool also but I won't go into any detail as the link above has more information on motion guides with Tweensy.</p>
<p>The Tweensy syntax is very similar to other tween engines and like the great AS2 tween engine FuseKit, Tweensy offers a series of methods which makes tweening otherwise complicated Objects easy. These methods include matrixTo, colorTransformTo, filterTo, functionTo, brightnessTo and contrastTo to name a few. Regardless of these methods the built-in to, from and fromTo methods provide the functionality of these functions - they are there purely for coding convenience. For example using Tweensy for tweening Matrices, ColorTransforms and SoundTransforms then applying them onto other Objects is quite easy. </p>
<pre class="actionscript">&nbsp;
<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">flashdynamix</span>.<span style="color: #006600;">motion</span>.<span style="color: #006600;">Tweensy</span>;
<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">geom</span>.<span style="color: #006600;">Matrix</span>;
&nbsp;
<span style="color: #0006ff; font-weight: bold;">var</span> mtx:Matrix = myInstance.<span style="color: #006600;">transform</span>.<span style="color: #006600;">matrix</span>;
mtx.<span style="color: #006600;">tx</span> = <span style="color: #cc66cc;">200</span>;
mtx.<span style="color: #006600;">ty</span> = <span style="color: #cc66cc;">200</span>;
Tweensy.<span style="color: #006600;">to</span><span style="color: #66cc66;">&#40;</span>myInstance.<span style="color: #006600;">transform</span>.<span style="color: #006600;">matrix</span>, mtx, <span style="color: #cc66cc;">2.0</span>, <span style="color: #0006ff; font-weight: bold;">null</span>, <span style="color: #cc66cc;">0</span>, myInstance<span style="color: #66cc66;">&#41;</span>;</pre>
<p>Further to this I will quickly introduce the method functionTo, it is particularly useful if tweening the width and height of a component of some type which requires this to be done via a setSize method. </p>
<pre class="actionscript">&nbsp;
<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">flashdynamix</span>.<span style="color: #006600;">motion</span>.<span style="color: #006600;">TweensyGroup</span>;
&nbsp;
<span style="color: #0006ff; font-weight: bold;">var</span> tween:TweensyGroup = <span style="color: #0006ff; font-weight: bold;">new</span> TweensyGroup<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0006ff; font-weight: bold;">var</span> <span style="color: #0066CC;">onUpdate</span>:<span style="color: #0006ff; font-weight: bold;">Function</span> = <span style="color: #0006ff; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>current:<span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
      pane.<span style="color: #006600;">setSize</span><span style="color: #66cc66;">&#40;</span>current.<span style="color: #0066CC;">width</span>, current.<span style="color: #0066CC;">height</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
tween.<span style="color: #006600;">functionTo</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">width</span>:pane.<span style="color: #006600;">paneWidth</span>, <span style="color: #0066CC;">height</span>:pane.<span style="color: #006600;">paneHeight</span><span style="color: #66cc66;">&#125;</span>, <span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">width</span>:<span style="color: #cc66cc;">200</span>, <span style="color: #0066CC;">height</span>:<span style="color: #cc66cc;">200</span><span style="color: #66cc66;">&#125;</span>, <span style="color: #0066CC;">onUpdate</span>, <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;</pre>
<p>Further to these cool features Tweensy offers an <a href="http://code.google.com/p/tweensy/wiki/AdvancedTween">extras package</a> containing classes to assist with matrix math for Transformations and ColorMatrixFilters. The MatrixTransform class allows for tweening transformations of skewX,skewY around a defined registration X and Y. While the ColorMatrix class allows for applying color transform effects such as brightness, contrast, threshold, colorize etc.</p>
<p>Though I hadn't mentioned it much above, TweensyFX hasn't gone without a few improvements these effects include <a href="http://www.flashdynamix.com/examples/Tweensy/0.2/bumpMapFX.html">Bump Mapping</a>, <a href="http://www.flashdynamix.com/examples/Tweensy/0.2/bulgeFX.html">Bulge(dent/indent)</a>, <a href="http://www.flashdynamix.com/examples/Tweensy/0.2/pixelateFX.html">pixelation</a>, rgb channel splitting, scan lines and reflection. These FX are mostly low hanging fruit so more exciting effects are to come. In case I hadn't mentioned it somewhere TweensyFX also allows the efficient drawing to a vector layer. As well tweening complicated vector elements such as curves, lines and gradients. This combined with the effects which can be applied onto a BitmapLayer in TweensyFX can result in some really nice results.</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_lineFX_354997159"
			class="flashmovie"
			width="550"
			height="400">
	<param name="movie" value="http://www.flashdynamix.com/examples/Tweensy/0.2/lineFX.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.flashdynamix.com/examples/Tweensy/0.2/lineFX.swf"
			name="fm_lineFX_354997159"
			width="550"
			height="400">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>I hope you enjoy Tweensy, I and everyone I have introduced it to are, as well those involved in the private beta who have provided great feedback - thankyou. TweensyFX is now the product I will focus on now I consider the Tweensy Original product is maturing nicely. Which is a great stage for this project and for me because this is work I find more  exciting.</p>
<p>As well as this update to Tweensy, I have been hard at work (in my limited spare time) on a AIR product code named 'Mr Sprite' which will support TweensyFX with sprite map animations. Mr Sprite can import or create a sprite sheet from a sprite sequence. Then allows for you to define animations sequences on the sprite sheet which can then easily be imported into Flash as a ByteArray at run-time or author-time. With Mr Sprite it will allow you to apply pre-rendered effects with dynamically generated ones at ease in an extremely optimized and efficient manner. I will try to get some examples and a private beta setup for this project soon.</p>
<p>Get Tweensy before it takes over the world at its new home on <a href="http://code.google.com/p/tweensy/">code.google</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lostinactionscript.com/blog/index.php/2009/01/05/tweensy-goes-public/feed/</wfw:commentRss>
		<slash:comments>43</slash:comments>
		</item>
		<item>
		<title>AS3 Tween Engine &#8211; Tweensy (Preview)</title>
		<link>http://www.lostinactionscript.com/blog/index.php/2008/08/31/as3-tween-engine-tweensy-preview/</link>
		<comments>http://www.lostinactionscript.com/blog/index.php/2008/08/31/as3-tween-engine-tweensy-preview/#comments</comments>
		<pubDate>Sat, 30 Aug 2008 18:15:15 +0000</pubDate>
		<dc:creator>Shane McCartney</dc:creator>
				<category><![CDATA[Interesting]]></category>
		<category><![CDATA[Play]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://www.lostinactionscript.com/blog/?p=73</guid>
		<description><![CDATA[
Dynamic tweening is really important to a Flash Developer, and when I was programming in AS2 my tweening library of choice was either FuseKit or the Zigo Engine. Since AS3 there have been a few options available:
Tweener
Tween Lite
Adobe's Tween
GTween
ASAP Tween
There have been many posts on how some are better in performance and features than others. [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.flashdynamix.com/blog/wp-content/uploads/2008/08/tweensy.jpg" alt="Tweensy AS3 Tweening Engine" /></p>
<p>Dynamic tweening is really important to a Flash Developer, and when I was programming in AS2 my tweening library of choice was either FuseKit or the Zigo Engine. Since AS3 there have been a few options available:</p>
<li>Tweener</li>
<li>Tween Lite</li>
<li>Adobe's Tween</li>
<li>GTween</li>
<li>ASAP Tween</li>
<p>There have been many posts on how some are better in performance and features than others. Without going into detail, I rate them in the following order, from best to worst:<br />
1) TweenLite/Max<br />
2) Tweener<br />
3) GTween<br />
4) ASAP Tween<br />
5) Adobe Tween</p>
<p>Even though there are 5 options above, the top 2 are the only ones I'd ever consider using. Even with this said, Tween Lite is good, but it's not a code library I'd prefer to use. If anyone cares to take a look through the source code, they’ll notice that it's not particularly clearly (well) written. Because of this, it's not exactly easy for a developer to extend Tween Lite/Max if they need to.</p>
<p>Introducing Tweensy, my new tweening engine, which has been in use for the last 8 months on many of my commercial projects, which I'll supply to the community free of charge (although donations are appreciated). As I mentioned above, Tween Lite/Max and Tweener are really the only libraries I feel I need to compare my performance and feature benchmarking with, to prove that Tweensy will equal, or more usually surpass the performance and features of the existing options. I'll post these performance/feature comparison tests in my next post.</p>
<p>More importantly than this, I think it's crucial that a new tweening engine should have its own unique point of difference. From my review of the above tweening engines, it is clear that they are built for a similar concept (property and motion tweening) and in a simplistic comparison they offer the same features with varying performance.</p>
<p>Tweensy, however, offers these unique features:</p>
<p>1) A Bitmap rendering feature allowing for Bitmap Effects not easily achieved from the Adobe filter set such as Directional Motion Blur, Liquid Theshold, Directional Displacement and Buldge/Skew Displacement.<br />
2) Particle Emitters to generate smoke, fire, abstract, and magical effects from your motion tweens.<br />
3) Vector shape Tweening<br />
4) Gradient Tweening</p>
<p>Well enough of the introduction - I'll show you some examples of what I've been able to achieve by utilising some of the features above. I recommend that you install the Flash Player 10 beta to get the best FPS results.</p>
<p><a href="http://www.flashdynamix.com/examples/Tweensy/Cloud_Rain.html"><img src="http://www.flashdynamix.com/blog/wp-content/uploads/2008/08/redCloud.jpg" alt="" /></a><a href="http://www.flashdynamix.com/examples/Tweensy/Alien_Rain.html"><img src="http://www.flashdynamix.com/blog/wp-content/uploads/2008/08/alienRain.jpg" alt="" /></a><a href="http://www.flashdynamix.com/examples/Tweensy/Slime.html"><img src="http://www.flashdynamix.com/blog/wp-content/uploads/2008/08/slime.jpg" alt="" /> </a><a href="http://www.flashdynamix.com/examples/Tweensy/Genie_Smoke.html"><img src="http://www.flashdynamix.com/blog/wp-content/uploads/2008/08/genieSmoke.jpg" alt="" /></a><a href="http://www.flashdynamix.com/examples/Tweensy/Fire.html"><img src="http://www.flashdynamix.com/blog/wp-content/uploads/2008/08/fire.jpg" alt="" /></a><a href="http://www.flashdynamix.com/examples/Tweensy/Fire_Smoke.html"><img src="http://www.flashdynamix.com/blog/wp-content/uploads/2008/08/fire_smoke.jpg" alt="" /></a><a href="http://www.flashdynamix.com/examples/Tweensy/Warp.html"><img src="http://www.flashdynamix.com/blog/wp-content/uploads/2008/08/warp.jpg" alt="" /></a><a href="http://www.flashdynamix.com/examples/Tweensy/Magic_Orbit.html"><img src="http://www.flashdynamix.com/blog/wp-content/uploads/2008/08/magicOrbit.jpg" alt="" /></a><a href="http://www.flashdynamix.com/examples/Tweensy/Zany_Bolts.html"><img src="http://www.flashdynamix.com/blog/wp-content/uploads/2008/08/zanyBolts.jpg" alt="" /></a></p>
<div class="clear"></div>
<p>So Tweensy is intended to provide motion effects, but at its core is an extremely efficient property tweening engine. As the name suggests, Tweensy is also designed to be very easy and flexible to use, so here's the code of how I created the fire effect example above.</p>
<pre class="actionscript">&nbsp;
<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">flashdynamix</span>.<span style="color: #006600;">effects</span>.<span style="color: #006600;">layers</span>.<span style="color: #006600;">DisplacementLayer</span>;
<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">flashdynamix</span>.<span style="color: #006600;">effects</span>.<span style="color: #006600;">*</span>;
<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">flashdynamix</span>.<span style="color: #006600;">effects</span>.<span style="color: #006600;">extras</span>.<span style="color: #006600;">Emittor</span>;
&nbsp;
 
&nbsp;
<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">*</span>;
<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">geom</span>.<span style="color: #006600;">ColorTransform</span>;
<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">utils</span>.<span style="color: #006600;">getDefinitionByName</span>;
&nbsp;
<span style="color: #0006ff; font-weight: bold;">var</span> tween:Tweensy = <span style="color: #0006ff; font-weight: bold;">new</span> Tweensy<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0006ff; font-weight: bold;">var</span> layer:DisplacementLayer = <span style="color: #0006ff; font-weight: bold;">new</span> DisplacementLayer<span style="color: #66cc66;">&#40;</span>tween, <span style="color: #cc66cc;">550</span>, <span style="color: #cc66cc;">400</span>, <span style="color: #cc66cc;">2</span>, <span style="color: #cc66cc;">2</span>, BlendMode.<span style="color: #006600;">NORMAL</span>, <span style="color: #cc66cc;">0.95</span>, <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">-6</span>, <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// This makes the layer offset each of the colour channels on each render so the result is black smoke</span>
layer.<span style="color: #006600;">ct</span>.<span style="color: #006600;">redOffset</span> = <span style="color: #cc66cc;">-20</span>;
layer.<span style="color: #006600;">ct</span>.<span style="color: #006600;">blueOffset</span> = <span style="color: #cc66cc;">-20</span>;
layer.<span style="color: #006600;">ct</span>.<span style="color: #006600;">greenOffset</span> = <span style="color: #cc66cc;">-20</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// This is the start colour for the fire</span>
<span style="color: #0006ff; font-weight: bold;">var</span> ct:ColorTransform = <span style="color: #0006ff; font-weight: bold;">new</span> ColorTransform<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">80</span>, <span style="color: #cc66cc;">30</span>, <span style="color: #cc66cc;">15</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// This is the display asset which will be used to render the flame effect</span>
<span style="color: #0006ff; font-weight: bold;">var</span> Flame: <span style="color: #0006ff; font-weight: bold;">Class</span> = getDefinitionByName<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Flame&quot;</span><span style="color: #66cc66;">&#41;</span> as <span style="color: #0006ff; font-weight: bold;">Class</span>;
&nbsp;
<span style="color: #0006ff; font-weight: bold;">var</span> emittor:Emittor = <span style="color: #0006ff; font-weight: bold;">new</span> Emittor<span style="color: #66cc66;">&#40;</span>tween, Flame, BlendMode.<span style="color: #0066CC;">ADD</span>, <span style="color: #cc66cc;">2</span>, <span style="color: #cc66cc;">0.73</span>, <span style="color: #cc66cc;">0.77</span>, <span style="color: #cc66cc;">5</span>, <span style="color: #cc66cc;">60</span>, <span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">-45</span>, <span style="color: #cc66cc;">90</span><span style="color: #66cc66;">&#41;</span>;
emittor.<span style="color: #006600;">startColor</span> = ct;
emittor.<span style="color: #006600;">startScale</span> = <span style="color: #cc66cc;">0.2</span>;
emittor.<span style="color: #006600;">endScale</span> = <span style="color: #cc66cc;">2</span>;
&nbsp;
addChild<span style="color: #66cc66;">&#40;</span>layer<span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
<p>Now before someone comments, I do realise that this isn't exactly 1 line of code. This is intentional because Tweensy is designed not only for the examples I demonstrate (examples are just to show what can be done), but provides a library with which you can create your own motion effects. This makes Tweensy a lot of fun to experiment with.</p>
<p>The source code to Tweensy is currently available as a public beta <a title="Tweensy.org" href="http://www.tweensy.org" target="_blank">here</a>. I am particularly interested in Flash developers who would like to get involved in creating their own motion effects examples to provide feedback and improve Tweensy. I hope to have a release version of Tweensy publicly available some in late October 2008 with a public beta available before then.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lostinactionscript.com/blog/index.php/2008/08/31/as3-tween-engine-tweensy-preview/feed/</wfw:commentRss>
		<slash:comments>57</slash:comments>
		</item>
		<item>
		<title>Google, Windows, Yahoo, Ask Maps API for AS3/AS2/Flex</title>
		<link>http://www.lostinactionscript.com/blog/index.php/2008/05/29/google-windows-yahoo-ask-maps-api-as3/</link>
		<comments>http://www.lostinactionscript.com/blog/index.php/2008/05/29/google-windows-yahoo-ask-maps-api-as3/#comments</comments>
		<pubDate>Wed, 28 May 2008 23:06:34 +0000</pubDate>
		<dc:creator>Shane McCartney</dc:creator>
				<category><![CDATA[Interesting]]></category>
		<category><![CDATA[Play]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://www.lostinactionscript.com/blog/index.php/2008/05/29/google-windows-yahoo-ask-maps-api-as3/</guid>
		<description><![CDATA[It's been some time coming though I've finally had time to finish the AS3 build of my universal maps code. It's available for download free of charge (though donations are apreciated) from the same SVN repository and the details for this are below. As well included is the original AS2 version in the legacy.zip file.
It's [...]]]></description>
			<content:encoded><![CDATA[<p>It's been some time coming though I've finally had time to finish the AS3 build of my universal maps code. It's available for download free of charge (though donations are apreciated) from the same SVN repository and the details for this are below. As well included is the original AS2 version in the legacy.zip file.</p>
<p>It's been a nice to re-build this project from scratch by taking full advantage of AS3 to simplify the original AS2 universal maps code as it's now 95 classes from over 500 but still offering almost all the inital functionality! As well not to mention the amazing performance differences between AVM1 and 2. I haven't gotten around to full documentation (will soon) but there are samples included on all the maps sources to easily get you started.</p>
<p>Here are some examples...</p>
<p>Google Maps<br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_SWFLoader.swf?url=GoogleMap_1923583411"
			class="flashmovie"
			width="512"
			height="512">
	<param name="movie" value="http://www.flashdynamix.com/examples/Maps/SWFLoader.swf?url=GoogleMap.swf" />
	<param name="base" value="http://www.flashdynamix.com/examples/Maps/" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.flashdynamix.com/examples/Maps/SWFLoader.swf?url=GoogleMap.swf"
			name="fm_SWFLoader.swf?url=GoogleMap_1923583411"
			width="512"
			height="512">
		<param name="base" value="http://www.flashdynamix.com/examples/Maps/" />
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>Windows Virtual Earth Maps<br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_SWFLoader.swf?url=WindowsMap_368034282"
			class="flashmovie"
			width="512"
			height="512">
	<param name="movie" value="http://www.flashdynamix.com/examples/Maps/SWFLoader.swf?url=WindowsMap.swf" />
	<param name="base" value="http://www.flashdynamix.com/examples/Maps/" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.flashdynamix.com/examples/Maps/SWFLoader.swf?url=WindowsMap.swf"
			name="fm_SWFLoader.swf?url=WindowsMap_368034282"
			width="512"
			height="512">
		<param name="base" value="http://www.flashdynamix.com/examples/Maps/" />
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>Google Mars Maps<br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_SWFLoader.swf?url=GoogleMapMars_668047686"
			class="flashmovie"
			width="512"
			height="512">
	<param name="movie" value="http://www.flashdynamix.com/examples/Maps/SWFLoader.swf?url=GoogleMapMars.swf" />
	<param name="base" value="http://www.flashdynamix.com/examples/Maps/" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.flashdynamix.com/examples/Maps/SWFLoader.swf?url=GoogleMapMars.swf"
			name="fm_SWFLoader.swf?url=GoogleMapMars_668047686"
			width="512"
			height="512">
		<param name="base" value="http://www.flashdynamix.com/examples/Maps/" />
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>Google Moon Maps<br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_SWFLoader.swf?url=GoogleMapMoon_1557013537"
			class="flashmovie"
			width="512"
			height="512">
	<param name="movie" value="http://www.flashdynamix.com/examples/Maps/SWFLoader.swf?url=GoogleMapMoon.swf" />
	<param name="base" value="http://www.flashdynamix.com/examples/Maps/" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.flashdynamix.com/examples/Maps/SWFLoader.swf?url=GoogleMapMoon.swf"
			name="fm_SWFLoader.swf?url=GoogleMapMoon_1557013537"
			width="512"
			height="512">
		<param name="base" value="http://www.flashdynamix.com/examples/Maps/" />
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>Download the source from the following SVN details<br />
SVN: http://mapsas3.googlecode.com/svn/trunk/</p>
<p>Don't have an SVN client? I recommend you use Tortoise - <a href="http://tortoisesvn.tigris.org/">get it here</a> or if you're an Eclipse user try <a href="http://subclipse.tigris.org/">Subclipse</a>
</p>
<p>To compile with Flex I used the command line arguments on the GoogleMapFlex example class :<br />
<code>-default-size 512 512 -default-frame-rate 31 -default-background-color 0x262B2D -library-path {flexSDK}/frameworks/locale/en_US -verbose-stacktraces</code><br />
To publish a different example using Flex just make sure the class extends UniMapFlex rather than UniMap and that's it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lostinactionscript.com/blog/index.php/2008/05/29/google-windows-yahoo-ask-maps-api-as3/feed/</wfw:commentRss>
		<slash:comments>59</slash:comments>
		</item>
		<item>
		<title>You Tube Flash AS3 / AS2 Data &amp; Player API</title>
		<link>http://www.lostinactionscript.com/blog/index.php/2007/10/13/flash-you-tube-api/</link>
		<comments>http://www.lostinactionscript.com/blog/index.php/2007/10/13/flash-you-tube-api/#comments</comments>
		<pubDate>Sat, 13 Oct 2007 05:56:02 +0000</pubDate>
		<dc:creator>Shane McCartney</dc:creator>
				<category><![CDATA[Play]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://www.lostinactionscript.com/blog/index.php/2007/10/13/flash-you-tube-api/</guid>
		<description><![CDATA[Recently I have been working on something involving the use of video content from You Tube. With the lack of a good API out there I created my own. Below is a simple example of this working with sample code to download further below.


<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="youTube"
			class="flashmovie"
			width="700"
			height="460">
	<param name="movie" value="/blog/wp-content/swf/youTube.swf" />
	<param name="base" value="/blog/wp-content/swf/" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/blog/wp-content/swf/youTube.swf"
			name="youTube"
			width="700"
			height="460">
		<param name="base" value="/blog/wp-content/swf/" />
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
AS3 example
&#160;
import com.flashdynamix.services.YouTube;
import com.flashdynamix.events.YouTubeEvent;
//
var [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I have been working on something involving the use of video content from You Tube. With the lack of a good API out there I created my own. Below is a simple example of this working with sample code to download further below.</p>
<p><script src="http://code.flashdynamix.com/YouTube/youTube.js" type="text/javascript"></script><br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="youTube"
			class="flashmovie"
			width="700"
			height="460">
	<param name="movie" value="/blog/wp-content/swf/youTube.swf" />
	<param name="base" value="/blog/wp-content/swf/" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/blog/wp-content/swf/youTube.swf"
			name="youTube"
			width="700"
			height="460">
		<param name="base" value="/blog/wp-content/swf/" />
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>AS3 example</p>
<pre class="actionscript">&nbsp;
<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">flashdynamix</span>.<span style="color: #006600;">services</span>.<span style="color: #006600;">YouTube</span>;
<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">flashdynamix</span>.<span style="color: #006600;">events</span>.<span style="color: #006600;">YouTubeEvent</span>;
<span style="color: #808080; font-style: italic;">//</span>
<span style="color: #0006ff; font-weight: bold;">var</span> yt:YouTube = <span style="color: #0006ff; font-weight: bold;">new</span> YouTube<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
yt.<span style="color: #006600;">clientKey</span> = <span style="color: #ff0000;">&quot;ytapi-ShaneMcCartney-flashdynamix-vuj2k916-0&quot;</span>;
<span style="color: #0006ff; font-weight: bold;">function</span> onLoaded<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:YouTubeEvent<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #b1b100;">switch</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #006600;">method</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #b1b100;">case</span> YouTube.<span style="color: #006600;">SEARCH</span> :
<span style="color: #b1b100;">for</span> each <span style="color: #66cc66;">&#40;</span><span style="color: #0006ff; font-weight: bold;">var</span> <span style="color: #0066CC;">video</span>:YouTubeVideo <span style="color: #b1b100;">in</span> <span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">data</span>.<span style="color: #0066CC;">list</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">video</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #b1b100;">break</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
<span style="color: #808080; font-style: italic;">//</span>
yt.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>YouTubeEvent.<span style="color: #006600;">COMPLETE</span>, onLoaded<span style="color: #66cc66;">&#41;</span>;
yt.<span style="color: #006600;">videosForTag</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Top Gear&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
<p>AS2 example</p>
<pre class="actionscript">&nbsp;
<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">FlashDynamix</span>.<span style="color: #006600;">services</span>.<span style="color: #006600;">YouTube</span>;
<span style="color: #808080; font-style: italic;">//</span>
<span style="color: #0006ff; font-weight: bold;">var</span> yt:YouTube = <span style="color: #0006ff; font-weight: bold;">new</span> YouTube<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
yt.<span style="color: #006600;">APIKey</span> = <span style="color: #ff0000;">&quot;WplekwLy_Nw&quot;</span>;
<span style="color: #0006ff; font-weight: bold;">var</span> obj:<span style="color: #0066CC;">Object</span> = <span style="color: #0006ff; font-weight: bold;">new</span> <span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
obj.<span style="color: #0066CC;">loaded</span> = <span style="color: #0006ff; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>evt:EventArgs<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #b1b100;">switch</span> <span style="color: #66cc66;">&#40;</span>evt.<span style="color: #0066CC;">type</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #b1b100;">case</span> YouTube.<span style="color: #006600;">VIDEOSBYTAG</span> :
<span style="color: #0006ff; font-weight: bold;">var</span> videos = evt.<span style="color: #006600;">value</span>.<span style="color: #0066CC;">video</span>;
<span style="color: #b1b100;">break</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>;
<span style="color: #808080; font-style: italic;">//</span>
yt.<span style="color: #006600;">addListeners</span><span style="color: #66cc66;">&#40;</span>obj<span style="color: #66cc66;">&#41;</span>;
yt.<span style="color: #006600;">videosbyTag</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Top Gear&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
<p>The class I created YouTube.as supports both the legacy and current version of the YouTube API <a href="http://www.youtube.com/dev_docs">legacy documentation</a> and <a href="http://code.google.com/apis/youtube/developers_guide_protocol.html">current documentation</a>.</p>
<p>Download the source from the following SVN details<br />
SVN: http://youtubeas3.googlecode.com/svn/trunk/</p>
<p>Don't have an SVN client? I recommend you use Tortoise - <a href="http://tortoisesvn.tigris.org/">get it here</a> or if you're an Eclipse user try <a href="http://subclipse.tigris.org/">Subclipse</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lostinactionscript.com/blog/index.php/2007/10/13/flash-you-tube-api/feed/</wfw:commentRss>
		<slash:comments>265</slash:comments>
		</item>
		<item>
		<title>Douglas Peuker Line Generalization</title>
		<link>http://www.lostinactionscript.com/blog/index.php/2007/07/11/douglas-peuker-line-generalization/</link>
		<comments>http://www.lostinactionscript.com/blog/index.php/2007/07/11/douglas-peuker-line-generalization/#comments</comments>
		<pubDate>Tue, 10 Jul 2007 14:41:35 +0000</pubDate>
		<dc:creator>Shane McCartney</dc:creator>
				<category><![CDATA[Play]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://www.lostinactionscript.com/blog/index.php/2007/07/11/douglas-peuker-line-generalization/</guid>
		<description><![CDATA[Just recently I have been working on some code which required line generalization for Flash from drawings / poly line data. I have posted up sample code and a demonstration SWF to show the results of these tests. I found that the Douglas Peuker algorithm was the simplest to implement the results are pretty good. [...]]]></description>
			<content:encoded><![CDATA[<p>Just recently I have been working on some code which required line generalization for Flash from drawings / poly line data. I have posted up sample code and a demonstration SWF to show the results of these tests. I found that the Douglas Peuker algorithm was the simplest to implement the results are pretty good. The only down point is code only usually runs in O(n log m) time where m the number of points is small. I would like to try and speed this up by a technique using the Melkman convex hull algorithm based on a paper written by Hershberger & Snoeyink they split the lower and higher bounds to increase performance on the simplification process. </p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_douglasPeuker_89928190"
			class="flashmovie"
			width="550"
			height="400">
	<param name="movie" value="http://www.flashdynamix.com/blog/wp-content/swf/douglasPeuker.swf" />
	<param name="bgcolor" value="#262B2D" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.flashdynamix.com/blog/wp-content/swf/douglasPeuker.swf"
			name="fm_douglasPeuker_89928190"
			width="550"
			height="400">
		<param name="bgcolor" value="#262B2D" />
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>Download the <a href="http://www.flashdynamix.com/downloads/LineGeneralization.zip">source code here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lostinactionscript.com/blog/index.php/2007/07/11/douglas-peuker-line-generalization/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Convex Hull Algorithms for Actionscript</title>
		<link>http://www.lostinactionscript.com/blog/index.php/2007/06/12/convex-hull-algorithms-for-actionscript/</link>
		<comments>http://www.lostinactionscript.com/blog/index.php/2007/06/12/convex-hull-algorithms-for-actionscript/#comments</comments>
		<pubDate>Mon, 11 Jun 2007 13:12:20 +0000</pubDate>
		<dc:creator>Shane McCartney</dc:creator>
				<category><![CDATA[Play]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">/blog/index.php/2007/06/12/convex-hull-algorithms-for-actionscript/</guid>
		<description><![CDATA[Recently I have been playing around with some code that required the use of Convex Hull's but I couldn't find any one who had ported these algorithms to Actionscript. If you don't know about Convex Hull's you can read about them here. I have written the Convex Hull Class to work with a few of [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I have been playing around with some code that required the use of Convex Hull's but I couldn't find any one who had ported these algorithms to Actionscript. If you don't know about Convex Hull's you can read about them <a href="http://en.wikipedia.org/wiki/Convex_hull_algorithms">here</a>. I have written the Convex Hull Class to work with a few of the popular algorithms as I was playing around with the pro's and con's of using each including :	</p>
<li>Graham Scan</li>
<li>Melkman</li>
<li>Jarvis March</li>
<li>BFP</li>
<p>An example SWF (AS2.0) using the ConvexHull.as Class is below (only with the Graham Scan Algorithm are the points draggable). I am surre if this was in AS3 it would run alot faster as most the memory is used in loop sorts<br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_convexHull_1239263984"
			class="flashmovie"
			width="500"
			height="500">
	<param name="movie" value="http://www.flashdynamix.com/blog/wp-content/swf/convexHull.swf" />
	<param name="bgcolor" value="#262B2D" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.flashdynamix.com/blog/wp-content/swf/convexHull.swf"
			name="fm_convexHull_1239263984"
			width="500"
			height="500">
		<param name="bgcolor" value="#262B2D" />
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object><br/></p>
<p>To download the source <a href="http://www.flashdynamix.com/downloads/ConvexHull.zip">click here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lostinactionscript.com/blog/index.php/2007/06/12/convex-hull-algorithms-for-actionscript/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
