<?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>zedia flash blog &#187; Tween</title>
	<atom:link href="http://www.zedia.net/tag/tween/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zedia.net</link>
	<description>Flash, ActionScript, SEO and everything in between</description>
	<lastBuildDate>Thu, 02 Feb 2012 17:58:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>ActionScript 3 TweenLite Basic Tutorial</title>
		<link>http://www.zedia.net/2008/actionscript-3-tweenlite-basic-tutorial/</link>
		<comments>http://www.zedia.net/2008/actionscript-3-tweenlite-basic-tutorial/#comments</comments>
		<pubDate>Sun, 02 Mar 2008 19:39:04 +0000</pubDate>
		<dc:creator>zedia.net</dc:creator>
				<category><![CDATA[TweenLite]]></category>
		<category><![CDATA[Tween]]></category>

		<guid isPermaLink="false">http://www.zedia.net/2008/actionscript-3-tweenlite-basic-tutorial/</guid>
		<description><![CDATA[If you have been following this blog for some time now you have witnessed my evolution in the use of tweening engines. I was first using the Tween classes from Adobe and made a tutorial about them. After that I found Tweener, which I liked a lot for it ease of use and its speed [...]]]></description>
			<content:encoded><![CDATA[<p>If you have been following this blog for some time now you have witnessed my evolution in the use of tweening engines. I was first using the Tween classes from Adobe and made a <a href="http:http://www.zedia.net/actionscript-3-tweens-tutorial/" title="ActionScript 3 tween tutorial">tutorial about them</a>. After that I found Tweener, which I liked a lot for it ease of use and its speed improvement so I modified my <a href="http://www.zedia.net/2007/actionscript-3-tweener-basic-tutorial/" title="Tweener Tutorial">tutorial to explain Tweener</a>. My new evolution in the field of tweening engine is TweenLite mostly because it is faster and lighter than Tweener. Since I did a tutorial on how to use the two previous tweening engines; it is only normal that I do one also for TweenLite.</p>
<p>Well the first thing you have to do is download the classes of <a href="http://blog.greensock.com/tweenliteas3" title="TweenLite" target="_blank">TweenLite</a>. After that you need to import the class in order to use it; here is the import statement:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">import</span> gs.<span style="color: #006600;">TweenLite</span>;
<span style="color: #0066CC;">import</span> fl.<span style="color: #006600;">motion</span>.<span style="color: #006600;">easing</span>.<span style="color: #66cc66;">*</span>;</pre></td></tr></table></div>

<p>TweenLite as the name states is really light; it weights only 2k which is better than Tweener(10k). As you can see in the previous code I also imported the Adobe easing function. If you want to use easing, you will have to do that also which will had an additional 1k to the package.</p>
<p>TweenLite syntax is really similar to Tweener which is good since that was an advantage of using Tweener. Here is a simple tween using TweenLite:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;">TweenLite.<span style="color: #006600;">to</span> <span style="color: #66cc66;">&#40;</span>rectangle, <span style="color: #cc66cc;">3</span>, <span style="color: #66cc66;">&#123;</span>x:<span style="color: #cc66cc;">300</span>, ease:Linear.<span style="color: #006600;">easeIn</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>The difference from Tweener&#8217;s syntax is that the second parameter in TweenLite is duration(how much time in seconds will the tween last) in this case 3 seconds. So this line of code will make the displayObject rectangle move from its currents position to a new position where its x value will be 300 in 3 seconds.</p>
<p>The same way you did it with Tweener, you can also tween multiple properties with TweenLite, here is an example:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;">TweenLite.<span style="color: #006600;">to</span><span style="color: #66cc66;">&#40;</span>rectangle, <span style="color: #cc66cc;">1</span>, <span style="color: #66cc66;">&#123;</span>x:<span style="color: #cc66cc;">300</span>, alpha:<span style="color: #cc66cc;">1</span>, scaleX:<span style="color: #cc66cc;">1.5</span>, scaleY:<span style="color: #cc66cc;">1.5</span>, delay:<span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>So this the rectangle will go to the x position 300, its alpha will raise to 100%, it will grow to 1.5 its original scale, all that in one second after a 2 second delay.</p>
<p>As you can see TweenLite offers all the advantages that Tweener offers with 2 more being light weight and being faster. I hope this tutorial will help you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zedia.net/2008/actionscript-3-tweenlite-basic-tutorial/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>

