<?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; Jack Doyle</title>
	<atom:link href="http://www.zedia.net/tag/jack-doyle/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>Shaving some kb when using TweenLite (or TweenMax)</title>
		<link>http://www.zedia.net/2009/shaving-some-kb-when-using-tweenlite-or-tweenmax/</link>
		<comments>http://www.zedia.net/2009/shaving-some-kb-when-using-tweenlite-or-tweenmax/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 23:57:36 +0000</pubDate>
		<dc:creator>zedia.net</dc:creator>
				<category><![CDATA[TweenLite]]></category>
		<category><![CDATA[banners]]></category>
		<category><![CDATA[Grant Skinner]]></category>
		<category><![CDATA[gTween]]></category>
		<category><![CDATA[Jack Doyle]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[TweenMax]]></category>

		<guid isPermaLink="false">http://www.zedia.net/?p=376</guid>
		<description><![CDATA[Introduction I was working on some banners lately and with banners, every kilobytes counts. So I downloaded the new version of  TweenLite for AS2 (because I can&#8217;t do shit without TweenLite) and noticed so weird behavior (not so weird once you understand about the file size. I mostly has to do with the new plugin [...]]]></description>
			<content:encoded><![CDATA[<h3>Introduction</h3>
<p>I was working on some banners lately and with banners, every kilobytes counts. So I downloaded the new version of  <a title="TweenLite" href="http://www.tweenlite.com" target="_blank">TweenLite</a> for AS2 (because I can&#8217;t do shit without TweenLite) and noticed so weird behavior (not so weird once you understand about the file size. I mostly has to do with the new plugin architecture, which I wasn&#8217;t acustumed to.</p>
<p>When you unpack the downloaded file from TweenLite, there is in there, a very usefull Plugin Explorer to help you understand how plugins work and to generate the code you need to activate only the plugins you want which looks something like:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">import</span> gs.<span style="color: #006600;">plugins</span>.<span style="color: #66cc66;">*</span>;
TweenPlugin.<span style="color: #006600;">activate</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span>ColorMatrixFilterPlugin, BlurFilterPlugin<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>With that code you would activate the ColorMatrixFilter plugin and the BlurFilter Plugin. I tought at first that that would be the only plugins activated and so the Plugin Explorer was telling me that if you activate only these plugin TweenLite should only add 5.5kb to my file.But that wasn&#8217;t what I was seeing it was more around 8kb (I know that isn&#8217;t much different but when you do banners, you fight for every kb).</p>
<h3>Here is the solution</h3>
<p>It turns out that when call the TweenPlugin.activate method, even if you say to activate only 2 plugins, it doesn&#8217;t deactivate the plugins that are activated by default. In order to do so, you have to go in the file TweenLite.as and comments the lines where these are activated like this:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">...
<span style="color: #808080; font-style: italic;">//this starts on line 257 of the TweenLite.as file VERSION: 10.09</span>
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> TweenLite<span style="color: #66cc66;">&#40;</span>$target:<span style="color: #0066CC;">Object</span>, $duration:<span style="color: #0066CC;">Number</span>, $vars:<span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>TweenLite.<span style="color: #006600;">timerClip</span>.<span style="color: #0066CC;">_visible</span> <span style="color: #66cc66;">!</span>= <span style="color: #000000; font-weight: bold;">false</span> <span style="color: #66cc66;">||</span> <span style="color: #66cc66;">!</span>_tlInitted<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
TweenPlugin.<span style="color: #006600;">activate</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">//ACTIVATE (OR DEACTIVATE) PLUGINS HERE...</span>
&nbsp;
<span style="color: #808080; font-style: italic;">//TintPlugin,</span>
<span style="color: #808080; font-style: italic;">// RemoveTintPlugin,</span>
<span style="color: #808080; font-style: italic;">//   FramePlugin,</span>
<span style="color: #808080; font-style: italic;">//   AutoAlphaPlugin,</span>
<span style="color: #808080; font-style: italic;">//    VisiblePlugin,</span>
<span style="color: #808080; font-style: italic;">//     VolumePlugin,</span>
<span style="color: #808080; font-style: italic;">//   EndArrayPlugin</span>
&nbsp;
<span style="color: #808080; font-style: italic;">//So by commenting these previous lines, these plugins won't be activated thus saving you some kb</span>
<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>You have to get your hands dirty, but in the end you gain a lot of flexibility plus you have only what you need activated.</p>
<h3>More stuff on TweenLite</h3>
<p>Well I&#8217;m always playing with TweenLite, so the other day I was using the ColorMatrixFilterPlugin on some really big MovieClips (9000px large). Well it turns out that Flash isn&#8217;t able to do bitmap manipulations (Matrices or Filters) on MovieClip bigger than 2800px.  So my Tweens on them would just not work (not TweenLite&#8217;s fault). What you have to do is segment your big MovieClip in chunks of 2800px and do a Tween on each of them at the same time.</p>
<p>Lastly, on the <a title="gTween and TweenLite unite" href="http://blog.greensock.com/gskinnercollaboration/" target="_blank">TweenLite website</a> today you could read that <a title="Jack Doyle" href="http://blog.greenshock.com" target="_blank">Jack Doyle</a> (TweenLite creator) and <a title="Grant Skinner" href="http://www.gskinner.com/blog/" target="_blank">Grant Skinner</a> (creator of gTween) will be working together on the next version of TweenLite/TweenMax. This can only mean great things for the future of this Tweening library! I look forward to the next version.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zedia.net/2009/shaving-some-kb-when-using-tweenlite-or-tweenmax/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

