<?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>alecmce.com &#187; animation</title>
	<atom:link href="http://alecmce.com/category/animation/feed" rel="self" type="application/rss+xml" />
	<link>http://alecmce.com</link>
	<description></description>
	<lastBuildDate>Thu, 10 Nov 2011 21:56:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>gaia-tween</title>
		<link>http://alecmce.com/animation/gaia-tween</link>
		<comments>http://alecmce.com/animation/gaia-tween#comments</comments>
		<pubDate>Sat, 23 Jul 2011 10:52:38 +0000</pubDate>
		<dc:creator>alecmce</dc:creator>
				<category><![CDATA[animation]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[tdd]]></category>

		<guid isPermaLink="false">http://alecmce.com/?p=1141</guid>
		<description><![CDATA[Today I have pushed the first version of a new open-source tween library to github/alecmce/gaia-tween. I have been working on it for some time, to provide a robust, flexible, extensible alternative to the Greensock stable of tween libraries (TweenMax, TweenLite, etc.). I have several reasons for choosing not to use Greensock libraries for tweening: I [...]]]></description>
			<content:encoded><![CDATA[<p>Today I have pushed the first version of a new open-source tween library to <a href="https://github.com/alecmce/gaia-tween">github/alecmce/gaia-tween</a>. I have been working on it for some time, to provide a robust, flexible, extensible alternative to the Greensock stable of tween libraries (TweenMax, TweenLite, etc.).</p>
<p>I have several reasons for choosing not to use Greensock libraries for tweening:</p>
<ul>
<li>I have great respect for TweenLite, but I have rarely used it in anger. Most of the time, the applications that I work on have some element of pay-to-play, and Greensock has <a href="http://www.greensock.com/licensing/">an unusual license</a> that has put-off at least two employers from using it. I do not want to learn a library that I can only use on some of my projects;</li>
<li>For all the clean code we try to write, Tweening libraries often jar with their funky APIs. I didn&#8217;t want my tweening library to be a statically-referenced black-box of almost unreadable code, I wanted it to have elements with well-defined responsibilities, objects that encapsulate concepts of time, tweens and eases. I wanted to be able to <acronym definition="Test Drive Development">TDD</acronym> these elements and offer my tests for public scrutiny. In short, I wanted my tweening library to feel more like the rest of my code and less like dark magic;</li>
<li>Probably most of all, I wanted to write it because I could, and because I hadn&#8217;t yet.</li>
</ul>
<h2>Speed and Memory</h2>
<div style="text-align: center; margin: auto;">
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_0" width="500" height="375">
      <param name="movie" value="http://alecmce.com/wp-content/uploads/2011/07/SpeedDemo1.swf" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://alecmce.com/wp-content/uploads/2011/07/SpeedDemo1.swf" width="500" height="375">
      <!--<![endif]-->
        
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>
<br/><a href="https://github.com/alecmce/gaia-tween/blob/master/demo/gaia/demo/tween/SpeedDemo.as">SpeedDemo.as source</a></div>
<p>In the tests that I have done so far, gaia-tween is fractionally behind TweenLite on speed. However, it is ahead in memory consumption! Currently the strategy for gaia-tween is to instantiate the elements that it needs and pool them indefinitely, so there is no garbage collection taking place, but I am looking to add that in as a future iteration. During tweening, no object is constructed nor destroyed by the tweening engine. Compare the memory profile of the two tween engines, from the SpeedDemo test below (<a href="https://github.com/alecmce/gaia-tween/blob/master/demo/gaia/demo/tween/SpeedDemo.as">SpeedDemo source here</a>):</p>
<h3>gaia-tween memory graph</h3>
<p><img src="http://alecmce.com/wp-content/uploads/2011/07/gaia-tween-memory.jpg" alt="" title="gaia-tween-memory" width="484" height="282" class="aligncenter size-full wp-image-1146" /></p>
<h3>TweenLite memory graph</h3>
<p><img src="http://alecmce.com/wp-content/uploads/2011/07/tweenlite-memory.jpg" alt="" title="tweenlite-memory" width="490" height="281" class="aligncenter size-full wp-image-1147" /></p>
<p>gaia-tween uses considerably less memory to run than TweenLite.</p>
<h2>Structure</h2>
<p>The API challenge was to find the right separation of responsibilities to keep the tween engine extensible without the extender having to do unnecessary work. The key features of this API are:</p>
<ul>
<li>Time is an independent concept from the tweening engine. A Time object is passed into the Tweening engine, which responds to changes in milliseconds-elapsed appropriately;</li>
<li>The ease functions have been simplified so that eases take one parameter &#8211; a proportion between 0 and 1, and return back a proportion between 0 and 1. This should make it easier for custom eases to be implemented;</li>
<li>The duration of a tween, the delay before starting it and any ease that may be applied to it are defined at the moment that a tween is added;</li>
<li>All other definition depends upon the context of the tween, and can be defined in a TweenForm. Currently three different kinds of TweenForms exist: a PropertyTweenForm for performing classic property tweens on objects; a ColorTweenForm for tweening the ColorTranform.color property of a DisplayObject; a MethodTweenForm for defining a method that will take the proportion between 0 and 1.</li>
</ul>
<p>This diagram may help explain the concepts more easily:</p>
<p><img src="http://alecmce.com/wp-content/uploads/2011/07/gaia-tween-explanation.jpg" alt="" title="gaia-tween-explanation" width="500" height="438" class="aligncenter size-full wp-image-1154" /></p>
<p>I have also added a convenience class that does the job of creating the TweenForms for you, <code><a href="https://github.com/alecmce/gaia-tween/blob/master/src/gaia/lib/tween/GaiaTweens.as">GaiaTweens.as</a></code>. This object-pools property tween forms and exposes a simplified API for those who want their tweening engine to keep everything under the hood.</p>
<h2>Examples</h2>
<p>The <code>ColorTweenForm</code> in action (roll-over to trigger):</p>
<div style="text-align: center; margin: auto;">
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_1" width="500" height="375">
      <param name="movie" value="http://alecmce.com/wp-content/uploads/2011/07/ColorDemo1.swf" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://alecmce.com/wp-content/uploads/2011/07/ColorDemo1.swf" width="500" height="375">
      <!--<![endif]-->
        
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>
<br/><a href="https://github.com/alecmce/gaia-tween/blob/master/demo/gaia/demo/tween/ColorDemo.as">ColorDemo.as source</a></div>
<p><br/></p>
<p>By passing in a different <code>Time</code> class, timeline animations are possible:</p>
<div style="text-align: center; margin: auto;">
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_2" width="500" height="375">
      <param name="movie" value="http://alecmce.com/wp-content/uploads/2011/07/TimelineDemo.swf" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://alecmce.com/wp-content/uploads/2011/07/TimelineDemo.swf" width="500" height="375">
      <!--<![endif]-->
        
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>
<br/><a href="https://github.com/alecmce/gaia-tween/blob/master/demo/gaia/demo/tween/TimelineDemo.as">TimelineDemo.as source</a></div>
</p>
<p>Some issues with time-lining remain, and will be worked on for future improvements to the engine.</p>
<h2>Notices and Signals</h2>
<p>I am a huge proponent of the <a href="https://github.com/robertpenner/as3-signals/wiki">as3-signals</a> library. When <a href="http://robertpenner.com/">Robert Penner</a> originally introduced Signals, I was working on something similar with my friend <a href="http://blog.vizio360.co.uk/">Simone</a>. Since that time I have used Signals in almost every project I have worked on. However, One thing I really want to be able to do is to define a signal that only exposes an <code>addOnce</code> method. I have advocated this but there is clearly a disagreement about the direction that signals should take. So, I have created my own &#8211; simplified &#8211; implementation of signals. For want of a better name, I&#8217;ve called them <a href="https://github.com/alecmce/gaia-tween/tree/master/src/gaia/lib/notice"><code>Notices</code></a>. However, if you are interested in using or trying-out gaia-tween but are committed to using Signals, there is a <a href="https://github.com/alecmce/gaia-tween/tree/signals">signals branch</a> that replaces the Notices with Signals.</p>
<h2>Feedback</h2>
<p>I have produced this for my work at <a href="http://www.gaiaonline.com/">Gaia Interactive</a>, but Gaia have agreed to it being released because we would greatly appreciate feedback about it so that it can be improved. Please comment on API decisions, code implementations, feature requests, and so on. The more feedback I get, the more likely I can produce a robust, scalable alternative to the Greensock tweening stable. Or of course, you could fork the library and help improve it more directly!</p>
]]></content:encoded>
			<wfw:commentRss>http://alecmce.com/animation/gaia-tween/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mr Tayto Website</title>
		<link>http://alecmce.com/animation/mr-tayto-website</link>
		<comments>http://alecmce.com/animation/mr-tayto-website#comments</comments>
		<pubDate>Sun, 14 Feb 2010 23:10:41 +0000</pubDate>
		<dc:creator>alecmce</dc:creator>
				<category><![CDATA[animation]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://alecmce.com/?p=599</guid>
		<description><![CDATA[Just before I left for San Francisco, I was asked to work on the Mr Tayto website for Yomego. During my time at Yomego, I was mostly working on big projects, some of which never really saw the light of day. This was a bit of light relief. The website was well received, Creative News [...]]]></description>
			<content:encoded><![CDATA[<p>Just before I left for San Francisco, I was asked to work on the <a href="http://mrtayto.ie/">Mr Tayto</a> website for <a href="www.yomego.com">Yomego</a>. During my time at Yomego, I was mostly working on big projects, some of which never really saw the light of day. This was a bit of light relief.</p>
<div style="text-align: center; margin: 0 auto; padding-bottom: 20px;">
 <a href="http://mrtayto.ie/"><img src="http://www.alecmce.com.php5-16.dfw1-1.websitetestlink.com/wp-content/uploads/2009/12/tayto11.png" alt="tayto1" title="tayto1" width="550" height="389" class="aligncenter size-full wp-image-600" /></a>
</div>
<div style="text-align: center; margin: 0 auto; padding-bottom: 20px;">
 <a href="http://mrtayto.ie/"><img src="http://www.alecmce.com.php5-16.dfw1-1.websitetestlink.com/wp-content/uploads/2009/12/tayto21.png" alt="tayto2" title="tayto2" width="550" height="370" class="aligncenter size-full wp-image-601" /></a>
</div>
<p>The website was well received, <a href="http://www.creativematch.com/viewNews/?98034">Creative News</a> attributing some of the success of the book to the website and the surrounding social media campaign.</p>
<p>The site itself was assembled in under two weeks by myself and Colin McKinney. The page turning mechanism was built from scratch in that time in order to guarantee integration with the initial animation sequence, the bookmark turn effects. More polish could have been applied with a longer time-frame, but this was not a bad effort, in the circumstances.</p>
]]></content:encoded>
			<wfw:commentRss>http://alecmce.com/animation/mr-tayto-website/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Further Festive Flakes</title>
		<link>http://alecmce.com/animation/further-festive-flakes</link>
		<comments>http://alecmce.com/animation/further-festive-flakes#comments</comments>
		<pubDate>Tue, 24 Nov 2009 16:16:01 +0000</pubDate>
		<dc:creator>alecmce</dc:creator>
				<category><![CDATA[animation]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[christmas]]></category>
		<category><![CDATA[snow]]></category>
		<category><![CDATA[snowflake]]></category>

		<guid isPermaLink="false">http://alecmce.com/?p=522</guid>
		<description><![CDATA[Some more programmatic snow: roll-over to activate This one is more simple, though the logic is exploded over multiple classes. You can get the source files here. I create a bunch of BitmapData objects with semi-transparent circles to represent snowflakes, called FlakeForms. Then, create a bunch of Flake objects which are essentially positions at which [...]]]></description>
			<content:encoded><![CDATA[<p>Some more programmatic snow:</p>
<div style="text-align: center; font-size: small; margin-bottom: 20px;">
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_3" width="550" height="400">
      <param name="movie" value="http://www.alecmce.com.php5-16.dfw1-1.websitetestlink.com/wp-content/uploads/2009/11/TestSnow1.swf" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://www.alecmce.com.php5-16.dfw1-1.websitetestlink.com/wp-content/uploads/2009/11/TestSnow1.swf" width="550" height="400">
      <!--<![endif]-->
        
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>
<br/>roll-over to activate</div>
<p>This one is more simple, though the logic is exploded over multiple classes. You can <a href='http://www.alecmce.com.php5-16.dfw1-1.websitetestlink.com/wp-content/uploads/2009/11/snow1.zip'>get the source files here</a>. I create a bunch of <code>BitmapData</code> objects with semi-transparent circles to represent snowflakes, called <code>FlakeForms</code>. Then, create a bunch of <code>Flake</code> objects which are essentially positions at which those formal flakes should be drawn. Each <code>EnterFrame</code>, wipe the <code>BitmapData</code> clean, <code>update</code> the flake positions and draw the formal flakes into the updated positions.</p>
<p><span id="more-522"></span></p>
<h3>FlakeForm</h3>
<pre class="brush: as3; title: ; notranslate">
/**
 * Copyright (c) 2009 Alec McEachran
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the &quot;Software&quot;), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 */
package
{
	import flash.display.BitmapData;
	import flash.display.Graphics;
	import flash.display.Shape;

	public class FlakeForm extends BitmapData
	{

		public function FlakeForm(radius:int, alpha:Number)
		{
			var n:int = radius &lt;&lt; 1;
			super(n, n, true, 0);

			var shape:Shape = new Shape();
			var graphics:Graphics = shape.graphics;

			graphics.beginFill(0xFFFFFF, alpha);
			graphics.drawCircle(radius, radius, radius);
			graphics.endFill();

			draw(shape);
		}
	}
}
</pre>
<h3>Flake</h3>
<pre class="brush: as3; title: ; notranslate">
/**
 * Copyright (c) 2009 Alec McEachran
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the &quot;Software&quot;), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 */
package
{
	import flash.display.BitmapData;
	import flash.geom.Point;
	import flash.geom.Rectangle;

	public class Flake
	{
		private const ORIGIN:Point = new Point(0, 0);

		private var form:FlakeForm;

		private var bounds:Rectangle;

		private var position:Point;
		private var x:Number;

		private var y:Number;

		private var dx:Number;

		private var dy:Number;

		public function Flake(form:FlakeForm, bounds:Rectangle):void
		{
			this.form = form;
			this.bounds = bounds;
			this.position = new Point();

			x = bounds.left + Math.random() * bounds.width;
			y = bounds.top - 20 + Math.random() * (bounds.height + 20);
			dx = Math.random() * 4.2 - 1.5;
			dy = Math.random() * 2 + 1;
		}

		public function update(bitmapData:BitmapData):void
		{
			x += dx;
			y += dy;

			if (x &gt; bounds.right)
				x = bounds.left + x - bounds.right;
			else if (x &lt; bounds.left)
				x = bounds.right + x - bounds.left;

			if (y &gt; bounds.bottom)
				y = bounds.top - 20;

			position.x = x;
			position.y = y;
			bitmapData.copyPixels(form, form.rect, position, null, ORIGIN, true);
		}
	}
}
</pre>
<h3>Snow</h3>
<pre class="brush: as3; title: ; notranslate">
/**
 * Copyright (c) 2009 Alec McEachran
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the &quot;Software&quot;), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 */
package
{
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.events.Event;
	import flash.geom.Rectangle;

	public class Snow extends Bitmap
	{

		private var count:int;

		private var flakes:Array;

		public function Snow(width:int, height:int, maxRadius:int, count:int, differentFlakes:int = 20)
		{
			super(new BitmapData(width, height, true, 0x00FFFFFF));
			this.count = count;

			var bounds:Rectangle = new Rectangle(0, 0, width, height);

			var factory:FlakeFactory = new FlakeFactory();
			var forms:Array = factory.generateForms(1, maxRadius, differentFlakes);
			flakes = factory.generateFlakes(count, bounds, forms);

			play();
		}

		public function play():void
		{
			addEventListener(Event.ENTER_FRAME, onEnterFrame);
		}

		public function stop():void
		{
			removeEventListener(Event.ENTER_FRAME, onEnterFrame);
		}

		private function onEnterFrame(event:Event):void
		{
			var i:int = count;

			bitmapData.fillRect(bitmapData.rect, 0x00FFFFFF);
			while (i--)
			{
				var flake:Flake = flakes[i];
				flake.update(bitmapData);
			}
		}
	}
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://alecmce.com/animation/further-festive-flakes/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Tweening with Tweensy &#8211; Properties and Colors</title>
		<link>http://alecmce.com/animation/tweening-with-tweensy</link>
		<comments>http://alecmce.com/animation/tweening-with-tweensy#comments</comments>
		<pubDate>Sun, 08 Nov 2009 22:01:12 +0000</pubDate>
		<dc:creator>alecmce</dc:creator>
				<category><![CDATA[animation]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[tweensy]]></category>

		<guid isPermaLink="false">http://alecmce.com/?p=459</guid>
		<description><![CDATA[I&#8217;ve started using Tweensy after realising that TweenMax requires a license fee for commercial use. Though my personal use is seldom commercial, why learn a library that&#8217;s useless to me when I am doing commercial work? Firstly, a big nod to Shane McCartney, who has done the hard work of creating this new tweening library. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve started using <a href="http://www.lostinactionscript.com/blog/index.php/2009/01/05/tweensy-goes-public/">Tweensy</a> after realising that <a href="http://blog.greensock.com/tweenmax/">TweenMax</a> requires a license fee for commercial use. Though my personal use is seldom commercial, why learn a library that&#8217;s useless to me when I am doing commercial work?</p>
<p>Firstly, a big nod to <a href="http://www.lostinactionscript.com">Shane McCartney</a>, who has done the hard work of creating this new tweening library.</p>
<p>A new library means learning a new syntax. As I go, I will post a few things that I learn along the road, since as yet, Tweensy is not that widespread:</p>
<h2>A Simple Tween</h2>
<p>To tween an object&#8217;s position you can use a static method, like TweenMax:</p>
<pre class="brush: as3; title: ; notranslate">
Tweensy.to(myDisplayObject, {x:300, y:100});
</pre>
<p>It will tween over half a second, unless you add a third parameter indicating the duration of time. This is very close to TweenMax. The static method produces a <code>TweensyTimeline</code>, or you could just create a new <code>TweensyTimeline</code> and add the various properties to it.</p>
<h2>A Color Tween</h2>
<p>To tween an object&#8217;s color, you can create a <code>TweensyGroup</code> and add a <code>colorTransformTo</code> call to it.</p>
<pre class="brush: as3; title: ; notranslate">
var tween:TweensyGroup = new TweensyGroup();
var color:ColorTransform = new ColorTransform();
color.color = 0xFF0000;
tween.colorTransformTo(myDisplayObject, color);
</pre>
<p>A <code>TweensyGroup</code> I thought? I bet you can tween more than just one item simultaneously with that. And so you can:</p>
<div style="text-align: center">
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_4" width="550" height="400">
      <param name="movie" value="http://www.alecmce.com.php5-16.dfw1-1.websitetestlink.com/wp-content/uploads/2009/11/TweensyTest1.swf" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://www.alecmce.com.php5-16.dfw1-1.websitetestlink.com/wp-content/uploads/2009/11/TweensyTest1.swf" width="550" height="400">
      <!--<![endif]-->
        
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>
</div>
<p></p>
<p>Roll-over to trigger the tweens. Click outside when you&#8217;ve had enough! If for some odd reason you want the source then <a href='http://alecmce.com/wp-content/uploads/2009/11/TweensyGroupTest.as'>you can download it here</a>.</p>
<h2>A bit of API confusion</h2>
<p>As yet, I&#8217;m not really clear what is the difference between a <code>TweensyGroup</code> and a <code>TweensyTimeline</code>. I&#8217;m sure it will become apparent. You can&#8217;t call <code>TweensyTimeline.colorTransformTo</code> though <code>TweensyGroup.colorTransformTo</code> returns a <code>TweensyTimeline</code>. My suspicion is that Shane spends longer at the chalk-face of creating his extremely impressive BitmapData effects than he does doing the dull-but-important job of ensuring that his API is clean and tidy. Alternatively, there may be a very good reason for the API decision, in which case I am extremely sorry for that supposition.</p>
]]></content:encoded>
			<wfw:commentRss>http://alecmce.com/animation/tweening-with-tweensy/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Not-Isometric Fun &#8211; Cuboids</title>
		<link>http://alecmce.com/animation/not-isometric-fun-cuboids</link>
		<comments>http://alecmce.com/animation/not-isometric-fun-cuboids#comments</comments>
		<pubDate>Tue, 20 Oct 2009 11:26:53 +0000</pubDate>
		<dc:creator>alecmce</dc:creator>
				<category><![CDATA[animation]]></category>
		<category><![CDATA[as3]]></category>

		<guid isPermaLink="false">http://alecmce.com/?p=396</guid>
		<description><![CDATA[I am doing some work on isometry and wanted to check how primitive objects look if they are not rendered isometrically&#8230; so I changed my &#8220;metrics&#8221; object to a non-isometric renderer, and this is the result! (It has an identical code base to my &#8216;isometric fun&#8217; with one class of about a dozen lines substituted [...]]]></description>
			<content:encoded><![CDATA[<div style="text-align: center; margin-bottom: 10px;">

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_5" width="550" height="400">
      <param name="movie" value="http://www.alecmce.com.php5-16.dfw1-1.websitetestlink.com/wp-content/uploads/2009/10/VisualizeMapCuboids1.swf" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://www.alecmce.com.php5-16.dfw1-1.websitetestlink.com/wp-content/uploads/2009/10/VisualizeMapCuboids1.swf" width="550" height="400">
      <!--<![endif]-->
        
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

</div>
<p>I am doing some work on isometry and wanted to check how primitive objects look if they are not rendered isometrically&#8230; so I changed my &#8220;metrics&#8221; object to a non-isometric renderer, and this is the result! (It has an identical code base to <a href="http://alecmce.com/as3/isometric-fun-cuboids">my &#8216;isometric fun&#8217;</a> with one class of about a dozen lines substituted in). It is both pretty, and architecturally elegant, so I thought I&#8217;d share it here.</p>
<p>Oh, and it qualifies as a non-unit test test case for my other &#8220;metrics&#8221; class &#8211; test driven development cannot always be done through a test runner.</p>
]]></content:encoded>
			<wfw:commentRss>http://alecmce.com/animation/not-isometric-fun-cuboids/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Isometric Fun &#8211; Cuboids</title>
		<link>http://alecmce.com/animation/isometric-fun-cuboids</link>
		<comments>http://alecmce.com/animation/isometric-fun-cuboids#comments</comments>
		<pubDate>Thu, 15 Oct 2009 22:33:52 +0000</pubDate>
		<dc:creator>alecmce</dc:creator>
				<category><![CDATA[animation]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[asunit]]></category>

		<guid isPermaLink="false">http://alecmce.com/?p=379</guid>
		<description><![CDATA[Test Driven Development is a wonderful thing. When I am calm, not under the pressure of deadlines and working most effectively, I would argue that TDD is the optimal way of working. Unfortunately, UI testing does not sit easily within TDD. To really check that graphical code works, you need to see it. I was [...]]]></description>
			<content:encoded><![CDATA[<div style="text-align: center; margin-bottom: 10px;">

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_6" width="500" height="400">
      <param name="movie" value="http://www.alecmce.com.php5-16.dfw1-1.websitetestlink.com/wp-content/uploads/2009/10/VisualizeCuboids11.swf" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://www.alecmce.com.php5-16.dfw1-1.websitetestlink.com/wp-content/uploads/2009/10/VisualizeCuboids11.swf" width="500" height="400">
      <!--<![endif]-->
        
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

</div>
<p>Test Driven Development is a wonderful thing. When I am calm, not under the pressure of deadlines and working most effectively, I would argue that TDD is the optimal way of working. Unfortunately, UI testing does not sit easily within TDD. To really check that graphical code works, you need to see it.</p>
<p>I was working back through isometry logic that I did almost a year ago, revisiting and writing fresh libraries for a project that my company is working on. I found myself needing to visually test that rendering cuboids in isometric space works exactly as I expect it to. It&#8217;s one thing for ASUnit to &#8216;run green&#8217; in the test cases that I could pre-calculate, and quite another to see all these lovely cuboids drawn out. These tests are useful additions to the suite of work, and I thought it was fun enough to share.</p>
]]></content:encoded>
			<wfw:commentRss>http://alecmce.com/animation/isometric-fun-cuboids/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Spinning Ball Effect</title>
		<link>http://alecmce.com/animation/spinning-ball-effect</link>
		<comments>http://alecmce.com/animation/spinning-ball-effect#comments</comments>
		<pubDate>Tue, 08 Sep 2009 08:09:36 +0000</pubDate>
		<dc:creator>alecmce</dc:creator>
				<category><![CDATA[animation]]></category>
		<category><![CDATA[as3]]></category>

		<guid isPermaLink="false">http://alecmce.com/?p=149</guid>
		<description><![CDATA[I had a lovely little distraction from normal work a couple of weeks ago: our designer Colin was creating some banner ads for Eircom&#8217;s Goal Machine game, and wanted a &#8216;spinning football&#8217; effect to go into an animation.]]></description>
			<content:encoded><![CDATA[<p>I had a lovely little distraction from normal work a couple of weeks ago: our designer <a href="http://www.colinmckinney.co.uk/">Colin</a> was creating some banner ads for Eircom&#8217;s <a href="http://bit.ly/hSHBz">Goal Machine</a> game, and wanted a &#8216;spinning football&#8217; effect to go into an animation.</p>
<div style="text-align: center; padding: 20px;"
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_7" width="362" height="104">
      <param name="movie" value="http://www.alecmce.com.php5-16.dfw1-1.websitetestlink.com/wp-content/uploads/2009/07/362x1041.swf" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://www.alecmce.com.php5-16.dfw1-1.websitetestlink.com/wp-content/uploads/2009/07/362x1041.swf" width="362" height="104">
      <!--<![endif]-->
        
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>
</div>
<p>It&#8217;s a small thing, and not my day-to-day job by any means, but a bit of programmatic animation was a welcome change from the long haul of UI, MMO and avatars.</p>
<p>The football was created using a DisplacementMap. It&#8217;s unusual to find a DisplacementMap example that isn&#8217;t a map of the Earth, but it works in the same way as all of those others, with the container being rotated as it goes.</p>
<p>A tutorial will follow, but the Displacement Map is about the most complicated bit of Flash to follow, particularly if you&#8217;re not a mathematician, so it will take some time to explain clearly! Watch this space.</p>
]]></content:encoded>
			<wfw:commentRss>http://alecmce.com/animation/spinning-ball-effect/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Moving Animations in Flash IDE</title>
		<link>http://alecmce.com/animation/moving-animations-in-flash-ide</link>
		<comments>http://alecmce.com/animation/moving-animations-in-flash-ide#comments</comments>
		<pubDate>Tue, 11 Aug 2009 12:05:19 +0000</pubDate>
		<dc:creator>alecmce</dc:creator>
				<category><![CDATA[animation]]></category>
		<category><![CDATA[jsfl]]></category>
		<category><![CDATA[extend]]></category>
		<category><![CDATA[Flash IDE]]></category>

		<guid isPermaLink="false">http://alecmce.com/?p=227</guid>
		<description><![CDATA[The designer Colin at our work uses the Flash IDE to create avatars and other animations, which we then import into applications and fiddle about with. He&#8217;s not very handy at working out where the registration point of a clip should go before he&#8217;s done the animation (for lots of good arty reasons), and we [...]]]></description>
			<content:encoded><![CDATA[<p>The designer <a href="http://www.colinmckinney.co.uk/">Colin</a> at our work uses the Flash IDE to create avatars and other animations, which we then import into applications and fiddle about with. He&#8217;s not very handy at working out where the registration point of a clip should go before he&#8217;s done the animation (for lots of good arty reasons), and we don&#8217;t really want him to nest an animation inside another MovieClip to correct the problem because it&#8217;s a bit messy to have to drill into the display list to find an animation.</p>
<p>If you have multiple frames of animation over multiple layers, there&#8217;s really no good way of moving all the elements in one go (or if there is, neither Colin nor I know about it), so I&#8217;ve created this little JSFL script wrapped into a Flash front-end for him.</p>
<div style="padding: 10px; float: right;">

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_8" width="140" height="140" align="left">
      <param name="movie" value="http://www.alecmce.com.php5-16.dfw1-1.websitetestlink.com/wp-content/uploads/2009/08/moveAnimation1.swf" />
      <param name="align" value="left" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://www.alecmce.com.php5-16.dfw1-1.websitetestlink.com/wp-content/uploads/2009/08/moveAnimation1.swf" width="140" height="140" align="left">
      <!--<![endif]-->
        
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

</div>
<p>This swf needs to be installed into your installation folder to function, which depends on your OS and Flash version. The paths for CS3 are:</p>
<ul>
<li>(WinXP) C:\Documents and Settings\[USER]\Local Settings\Application Data\Adobe\Flash CS3\[LANG]\Configuration\WindowSWF</li>
<li>(OSX) /Users/[USER]/Library/Application Support/Adobe/Flash CS3/[LANG]/Configuration/WindowSWF
</ul>
<p>where [USER] is your username, and [LANG] is your language (probably &#8220;en&#8221;).</p>
<p>What it does is pretty simple: Whatever is on stage at the time will all get moved by the amount you specify. It will not respect locked layers, if it&#8217;s an element on stage, it&#8217;s getting moved!</p>
<h3>Source FLA</h3>
<div style="float: left; padding: 10px;"><a href='http://alecmce.com/wp-content/uploads/2009/08/moveAnimation.fla'><img src="http://www.alecmce.com.php5-16.dfw1-1.websitetestlink.com/wp-content/uploads/2009/08/fl_small1.gif" alt="FLA" title="FLA" width="50" height="50" class="alignleft size-full wp-image-33" /></a></div>
<p>You are welcome to inspect the source, compile it yourself, so-on and so forth. The source FLA is <a href='http://alecmce.com/wp-content/uploads/2009/08/moveAnimation.fla'>here</a>. If you do download the file, you will note that I embedded the jsfl code into the fla, wrapped into an XML cdata tag. This is just because you&#8217;re not allowed to break Strings across lines in the Flash IDE Actions panel.</p>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://alecmce.com/animation/moving-animations-in-flash-ide/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>

