<?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; tweensy</title>
	<atom:link href="http://alecmce.com/tag/tweensy/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>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_0" 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>
	</channel>
</rss>

