<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Sacrosanct Design</title>
	
	<link>http://blog.designmarco.com</link>
	<description>A blog about Flash Actionscript and related technologies.</description>
	<lastBuildDate>Mon, 29 Mar 2010 03:01:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/designmarco/Tgje" /><feedburner:info uri="designmarco/tgje" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:browserFriendly></feedburner:browserFriendly><item>
		<title>Greensock Tweening Platform TextEffect Plugins</title>
		<link>http://blog.designmarco.com/2009/11/12/greensock-tweening-platform-texteffect-plugins/</link>
		<comments>http://blog.designmarco.com/2009/11/12/greensock-tweening-platform-texteffect-plugins/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 19:23:11 +0000</pubDate>
		<dc:creator>Marco</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[DecoderTextPlugin]]></category>
		<category><![CDATA[Greensock Tweening Platform]]></category>
		<category><![CDATA[Tween]]></category>
		<category><![CDATA[TypewriterPlugin]]></category>

		<guid isPermaLink="false">http://blog.designmarco.com/?p=84</guid>
		<description><![CDATA[I recently needed the following text effects for a project, and knew they would make perfect TweenLite/TweenMax plugins. Download Example Source TypewriterPlugin.as /** VERSION: 1.2 DATE: 3/27/2010 ACTIONSCRIPT VERSION: 3.0 @author Marco Di Giuseppe, marco [at] designmarco [dot] com @link http://designmarco.com */ package com.greensock.plugins &#123; import flash.text.TextField; import com.greensock.TweenLite; import com.greensock.plugins.TweenPlugin; /** TypewriterPlugin tweens the [...]]]></description>
			<content:encoded><![CDATA[<p>I recently needed the following text effects for a project,  and knew they would make perfect TweenLite/TweenMax plugins.</p>
<p>
<object width="480" height="320">
<param name="movie" value="/wp-content/uploads/2009/11/TextPluginDemo.swf"></param>
<param name="quality" value="high"></param>
<param name="wmode" value="window"></param>
<param name="menu" value="false"></param>
<param name="bgcolor" value="#FFFFFF"></param>
<embed type="application/x-shockwave-flash" width="480" height="320" src="/wp-content/uploads/2009/11/TextPluginDemo.swf" quality="high" bgcolor="#FFFFFF" wmode="window" menu="false" ></embed>
</object>
</p>
<p><a href="http://blog.designmarco.com/downloads/TextEffects%20Plugin%20Demo" >Download Example Source</a></p>
<p>TypewriterPlugin.as</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #3f5fbf;">/**
   VERSION: 1.2
   DATE: 3/27/2010
   ACTIONSCRIPT VERSION: 3.0
   @author Marco Di Giuseppe, marco [at] designmarco [dot] com
   @link http://designmarco.com
 */</span>
<span style="color: #9900cc; font-weight: bold;">package</span> com.greensock.plugins
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span>.<span style="color: #004993;">TextField</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> com.greensock.TweenLite;
	<span style="color: #0033ff; font-weight: bold;">import</span> com.greensock.plugins.TweenPlugin;
	<span style="color: #3f5fbf;">/**
	   TypewriterPlugin tweens the characters of a Textfield simulating a typing effect.
&nbsp;
	   @usage
	   import com.greensock.TweenLite;
	   import com.greensock.plugins.TweenPlugin;
	   import com.greensock.plugins.TypewriterPlugin;
&nbsp;
	   TweenPlugin.activate([TypewriterPlugin]); //activation is permanent in the SWF, so this line only needs to be run once.
	   TweenLite.to(textField, 0.5, {typewriter:&quot;Lorem Ipsum&quot;});
&nbsp;
	   Greensock Tweening Platform
	   @author Jack Doyle, jack@greensock.com
	   Copyright 2010, GreenSock. All rights reserved. This work is subject to the terms in http://www.greensock.com/terms_of_use.html
	   or for corporate Club GreenSock members, the software agreement that was issued with the corporate membership.
	 */</span>
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> TypewriterPlugin extends TweenPlugin
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> static const API<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = <span style="color: #000000; font-weight:bold;">1.0</span>;
		<span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">target</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">TextField</span>;
		<span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #6699cc; font-weight: bold;">var</span> newText<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span>;
		<span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #6699cc; font-weight: bold;">var</span> newLength<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span>;
		<span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #6699cc; font-weight: bold;">var</span> oldText<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span>;
		<span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #6699cc; font-weight: bold;">var</span> oldLength<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span>;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> TypewriterPlugin<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #0033ff; font-weight: bold;">this</span>.propName = <span style="color: #990000;">&quot;typewriter&quot;</span>;
			<span style="color: #0033ff; font-weight: bold;">this</span>.overwriteProps = <span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		override <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> onInitTween<span style="color: #000000;">&#40;</span><span style="color: #004993;">target</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Object</span>, <span style="color: #004993;">value</span><span style="color: #000000; font-weight: bold;">:*</span>, tween<span style="color: #000000; font-weight: bold;">:</span>TweenLite<span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight: bold;">!</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">target</span> <span style="color: #0033ff; font-weight: bold;">is</span> <span style="color: #004993;">TextField</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #0033ff; font-weight: bold;">return</span> <span style="color: #0033ff; font-weight: bold;">false</span>;
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">target</span> = <span style="color: #004993;">target</span> <span style="color: #0033ff; font-weight: bold;">as</span> <span style="color: #004993;">TextField</span>;
&nbsp;
			oldText = <span style="color: #004993;">target</span>.<span style="color: #004993;">text</span>;
			oldLength = oldText.<span style="color: #004993;">length</span>;
&nbsp;
			newText = <span style="color: #004993;">String</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">value</span><span style="color: #000000;">&#41;</span>;
			newLength = newText.<span style="color: #004993;">length</span>;
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">return</span> <span style="color: #0033ff; font-weight: bold;">true</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		override <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">set</span> changeFactor<span style="color: #000000;">&#40;</span>n<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> valueA<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = oldLength <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight: bold;">-</span>oldLength <span style="color: #000000; font-weight: bold;">*</span> n<span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> valueB<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = oldLength <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>newLength <span style="color: #000000; font-weight: bold;">-</span> oldLength<span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">*</span> n<span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">target</span>.<span style="color: #004993;">text</span> = newText.<span style="color: #004993;">substr</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #004993;">int</span><span style="color: #000000;">&#40;</span>valueB <span style="color: #000000; font-weight: bold;">-</span> valueA <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #000000; font-weight:bold;">0.5</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">+</span> oldText.<span style="color: #004993;">substr</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #004993;">int</span><span style="color: #000000;">&#40;</span>valueA <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #000000; font-weight:bold;">0.5</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>DecoderTextPlugin.as</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #3f5fbf;">/**
   VERSION: 1.2
   DATE:3/27/2010
   ACTIONSCRIPT VERSION: 3.0
   @author Marco Di Giuseppe, marco [at] designmarco [dot] com
   @link http://designmarco.com
 */</span>
<span style="color: #9900cc; font-weight: bold;">package</span> com.greensock.plugins
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span>.<span style="color: #004993;">TextField</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> com.greensock.TweenLite;
	<span style="color: #0033ff; font-weight: bold;">import</span> com.greensock.plugins.TweenPlugin;
	<span style="color: #3f5fbf;">/**
	   DecoderTextPlugin tweens the characters of a TextField giving the appearance of text decoding.
&nbsp;
	   @usage
	   import com.greensock.TweenLite;
	   import com.greensock.plugins.TweenPlugin;
	   import com.greensock.plugins.DecoderTextPlugin;
&nbsp;
	   TweenPlugin.activate([DecoderTextPlugin]); //activation is permanent in the SWF, so this line only needs to be run once.
	   TweenLite.to(textField, 0.5, {decoder:&quot;Lorem Ipsum&quot;});
&nbsp;
	   Greensock Tweening Platform
	   @author Jack Doyle, jack@greensock.com
	   Copyright 2010, GreenSock. All rights reserved. This work is subject to the terms in http://www.greensock.com/terms_of_use.html
	   or for corporate Club GreenSock members, the software agreement that was issued with the corporate membership.
	 */</span>
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> DecoderTextPlugin extends TweenPlugin
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> static const API<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = <span style="color: #000000; font-weight:bold;">1.0</span>;
		<span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">target</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">TextField</span>;
		<span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #6699cc; font-weight: bold;">var</span> tween<span style="color: #000000; font-weight: bold;">:</span>TweenLite;
		<span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #6699cc; font-weight: bold;">var</span> prevTime<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = <span style="color: #000000; font-weight:bold;">0</span>;
		<span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #6699cc; font-weight: bold;">var</span> oldText<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span>;
		<span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #6699cc; font-weight: bold;">var</span> oldLength<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span>;
		<span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #6699cc; font-weight: bold;">var</span> newText<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span>;
		<span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #6699cc; font-weight: bold;">var</span> newLength<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span>;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> DecoderTextPlugin<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">this</span>.propName = <span style="color: #990000;">&quot;decoder&quot;</span>;
			<span style="color: #0033ff; font-weight: bold;">this</span>.overwriteProps = <span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		override <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> onInitTween<span style="color: #000000;">&#40;</span><span style="color: #004993;">target</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Object</span>, <span style="color: #004993;">value</span><span style="color: #000000; font-weight: bold;">:*</span>, tween<span style="color: #000000; font-weight: bold;">:</span>TweenLite<span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight: bold;">!</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">target</span> <span style="color: #0033ff; font-weight: bold;">is</span> <span style="color: #004993;">TextField</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #0033ff; font-weight: bold;">return</span> <span style="color: #0033ff; font-weight: bold;">false</span>;
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">target</span> = <span style="color: #004993;">target</span> <span style="color: #0033ff; font-weight: bold;">as</span> <span style="color: #004993;">TextField</span>;
			<span style="color: #0033ff; font-weight: bold;">this</span>.tween = tween;
&nbsp;
			oldText = <span style="color: #004993;">target</span>.<span style="color: #004993;">text</span>;
			oldLength = oldText.<span style="color: #004993;">length</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #000000; font-weight:bold;">1</span>;
&nbsp;
			newText = <span style="color: #004993;">String</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">value</span><span style="color: #000000;">&#41;</span>;
			newLength = newText.<span style="color: #004993;">length</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #000000; font-weight:bold;">1</span>;
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">return</span> <span style="color: #0033ff; font-weight: bold;">true</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		override <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">set</span> changeFactor<span style="color: #000000;">&#40;</span>n<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> counter<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span>, valueA<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span>, valueB<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span>;
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>tween.cachedTime <span style="color: #000000; font-weight: bold;">&gt;</span> prevTime<span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				counter = <span style="color: #004993;">int</span><span style="color: #000000;">&#40;</span>newLength <span style="color: #000000; font-weight: bold;">*</span> n <span style="color: #000000; font-weight: bold;">-</span> <span style="color: #000000; font-weight:bold;">1</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #000000; font-weight:bold;">0.5</span><span style="color: #000000;">&#41;</span>;
				valueA = newText.<span style="color: #004993;">substr</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span>, counter<span style="color: #000000;">&#41;</span>;
				valueB = newText.<span style="color: #004993;">substr</span><span style="color: #000000;">&#40;</span>counter<span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">else</span>
			<span style="color: #000000;">&#123;</span>
				counter = <span style="color: #004993;">int</span><span style="color: #000000;">&#40;</span>oldLength <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">1</span> <span style="color: #000000; font-weight: bold;">-</span> n<span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">-</span> <span style="color: #000000; font-weight:bold;">1</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #000000; font-weight:bold;">0.5</span><span style="color: #000000;">&#41;</span>;
				valueA = oldText.<span style="color: #004993;">substr</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span>, counter<span style="color: #000000;">&#41;</span>;
				valueB = oldText.<span style="color: #004993;">substr</span><span style="color: #000000;">&#40;</span>counter<span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #6699cc; font-weight: bold;">var</span> decoder<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;&quot;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> i<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span> = valueB.<span style="color: #004993;">length</span>;
			<span style="color: #0033ff; font-weight: bold;">while</span> <span style="color: #000000;">&#40;</span>i<span style="color: #000000; font-weight: bold;">--</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				decoder <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #004993;">String</span>.<span style="color: #004993;">fromCharCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Math</span>.<span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight:bold;">26</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #000000; font-weight:bold;">65</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #004993;">target</span>.<span style="color: #004993;">text</span> = valueA <span style="color: #000000; font-weight: bold;">+</span> decoder;
			prevTime = tween.cachedTime;
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.designmarco.com/2009/11/12/greensock-tweening-platform-texteffect-plugins/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>AS3 PV3D Preloader</title>
		<link>http://blog.designmarco.com/2008/05/26/as3-pv3d-preloader/</link>
		<comments>http://blog.designmarco.com/2008/05/26/as3-pv3d-preloader/#comments</comments>
		<pubDate>Tue, 27 May 2008 04:15:15 +0000</pubDate>
		<dc:creator>Marco</dc:creator>
				<category><![CDATA[Papervision3D]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Preloader]]></category>
		<category><![CDATA[TweenLite]]></category>

		<guid isPermaLink="false">http://blog.designmarco.com/?p=16</guid>
		<description><![CDATA[Preloading is crucial when you have to load anything that takes more than a couple seconds. I’ve never liked the popular export to frame two, movie clip on the stage containing every single asset technique either. In my opinion it always felt like a hack, and somewhat of a hassle when you have larger files. [...]]]></description>
			<content:encoded><![CDATA[<p>Preloading is crucial when you have to load anything that takes more than a couple seconds. I’ve never liked the popular export to frame two, movie clip on the stage containing every single asset technique either. In my opinion it always felt like a hack, and somewhat of a hassle when you have larger files. I also prefer to have a single empty key frame on the main time line, so I created this preloader. It’s essentially a wrapper swf that loads your main swf which contain all the assets. I also thought this would be the perfect opportunity to represent Papervision3D by rocking the logo. The preloader is only 10k total, and uses<a href="http://tweenlite.com" title="TweenLite" > TweenLite</a>. You’ll also need the latest PV3D 2.0 classes which can be found <a href="http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/" >HERE</a>.</p>
<p><a href="http://blog.designmarco.com/downloads/PV3D%20AS3%20Preloader" >Download Source</a><br />
<a href="http://blog.designmarco.com/wp-content/uploads/2008/pv3dpreloader" >View Swf</a></p>
<p>Preloader.as</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #3f5fbf;">/**
 * AS3 PV3D Preloader v2.2
 * Copyright (c) 2009 Marco Di Giuseppe	- http://designmarco.com
 *
 * 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.
 */</span>
<span style="color: #9900cc; font-weight: bold;">package</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">Sprite</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">Loader</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">Stage</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">StageScaleMode</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">StageQuality</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">StageAlign</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">Event</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">IEventDispatcher</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">IOErrorEvent</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">ProgressEvent</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.net</span>.<span style="color: #004993;">URLRequest</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> com.greensock.easing.Expo;
	<span style="color: #0033ff; font-weight: bold;">import</span> com.greensock.TweenLite;
	<span style="color: #3f5fbf;">/**
	 * Preloader Class Loads an External swf while
	 * animating a movieclip from the Library
	 */</span>
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> Preloader extends <span style="color: #004993;">Sprite</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> swf<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;main.swf&quot;</span>; <span style="color: #009900;">//name of swf we are preloading</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> inertia<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = <span style="color: #000000; font-weight:bold;">5</span>; <span style="color: #009900;">//amount of easing applied to progress bar</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> wait<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = <span style="color: #000000; font-weight:bold;">2</span>; <span style="color: #009900;">// duration of time before loading begins</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> preloader<span style="color: #000000; font-weight: bold;">:</span>PreloadClip; <span style="color: #009900;">// library movieclip of logo</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> barRatio<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span>; <span style="color: #009900;">// length of bar divided by 100</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> Preloader<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">ENTER_FRAME</span>, checkStage, <span style="color: #0033ff; font-weight: bold;">false</span>, <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * Verify that the stage has been established by the browser
		 * @param	event
		 */</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> checkStage<span style="color: #000000;">&#40;</span>event<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">stage</span>.<span style="color: #004993;">stageHeight</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight:bold;">0</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #004993;">stage</span>.<span style="color: #004993;">stageWidth</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">ENTER_FRAME</span>, checkStage<span style="color: #000000;">&#41;</span>;
				<span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * Initialize Preloader
		 */</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #004993;">stage</span>.<span style="color: #004993;">scaleMode</span> = <span style="color: #990000;">&quot;noScale&quot;</span>;
			<span style="color: #004993;">stage</span>.<span style="color: #004993;">quality</span> = <span style="color: #990000;">&quot;High&quot;</span>;
			<span style="color: #004993;">stage</span>.<span style="color: #004993;">align</span> = <span style="color: #990000;">&quot;TL&quot;</span>;
&nbsp;
			preloader = <span style="color: #0033ff; font-weight: bold;">new</span> PreloadClip<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>preloader<span style="color: #000000;">&#41;</span>;
&nbsp;
			barRatio = preloader.progress_mc.bar.<span style="color: #004993;">width</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">100</span>;
			preloader.<span style="color: #004993;">x</span> = <span style="color: #004993;">stage</span>.<span style="color: #004993;">stageWidth</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight:bold;">0.5</span> <span style="color: #000000; font-weight: bold;">-</span> preloader.<span style="color: #004993;">width</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight:bold;">0.5</span>;
			preloader.<span style="color: #004993;">y</span> = <span style="color: #004993;">stage</span>.<span style="color: #004993;">stageHeight</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight:bold;">0.3</span>;
			preloader.progress_mc.bar.<span style="color: #004993;">width</span> = <span style="color: #000000; font-weight:bold;">0</span>;
&nbsp;
			<span style="color: #6699cc; font-weight: bold;">var</span> i<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span> = preloader.<span style="color: #004993;">numChildren</span> <span style="color: #000000; font-weight: bold;">-</span> <span style="color: #000000; font-weight:bold;">1</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> logo<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Sprite</span>;
			<span style="color: #0033ff; font-weight: bold;">while</span> <span style="color: #000000;">&#40;</span>i<span style="color: #000000; font-weight: bold;">--</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				logo = preloader.<span style="color: #004993;">getChildByName</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;m&quot;</span> <span style="color: #000000; font-weight: bold;">+</span> i<span style="color: #000000;">&#41;</span> <span style="color: #0033ff; font-weight: bold;">as</span> <span style="color: #004993;">Sprite</span>;
				TweenLite.from<span style="color: #000000;">&#40;</span>logo, <span style="color: #000000; font-weight:bold;">0.4</span>, <span style="color: #000000;">&#123;</span> <span style="color: #004993;">scaleX</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #000000; font-weight:bold;">10</span>, <span style="color: #004993;">scaleY</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #000000; font-weight:bold;">10</span>, <span style="color: #004993;">alpha</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #004993;">delay</span><span style="color: #000000; font-weight: bold;">:</span>i <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight:bold;">0.1</span>, ease<span style="color: #000000; font-weight: bold;">:</span>Expo.easeOut <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
&nbsp;
			TweenLite.delayedCall<span style="color: #000000;">&#40;</span>wait, loadContent<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * Begin Loading Process
		 */</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> loadContent<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">loader</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Loader</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Loader</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> request<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">URLRequest</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">URLRequest</span><span style="color: #000000;">&#40;</span>swf<span style="color: #000000;">&#41;</span>;
			setListeners<span style="color: #000000;">&#40;</span><span style="color: #004993;">loader</span>.<span style="color: #004993;">contentLoaderInfo</span>, <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>request<span style="color: #000000;">&#41;</span> <span style="color: #004993;">loader</span>.<span style="color: #004993;">load</span><span style="color: #000000;">&#40;</span>request<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * Display Loading Progress
		 * @param	event
		 */</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> progressHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">ProgressEvent</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> percentLoaded<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = <span style="color: #004993;">int</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>event.<span style="color: #004993;">bytesLoaded</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">1024</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000;">&#40;</span>event.<span style="color: #004993;">bytesTotal</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">1024</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight:bold;">100</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> barWidth<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> =  barRatio <span style="color: #000000; font-weight: bold;">*</span> percentLoaded;
			preloader.progress_mc.loading_txt.<span style="color: #004993;">text</span> = <span style="color: #004993;">String</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">int</span><span style="color: #000000;">&#40;</span>percentLoaded<span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #990000;">&quot;%&quot;</span><span style="color: #000000;">&#41;</span>;
			preloader.progress_mc.bar.<span style="color: #004993;">width</span> <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #000000;">&#40;</span>barWidth <span style="color: #000000; font-weight: bold;">-</span> preloader.progress_mc.bar.<span style="color: #004993;">width</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">/</span> inertia;
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>percentLoaded <span style="color: #000000; font-weight: bold;">&gt;</span>= <span style="color: #000000; font-weight:bold;">100</span><span style="color: #000000;">&#41;</span> preloader.<span style="color: #004993;">visible</span> = <span style="color: #0033ff; font-weight: bold;">false</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * Handle possible Loading Error
		 * @param	event
		 */</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> ioErrorHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">IOErrorEvent</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;ioErrorHandler: &quot;</span> <span style="color: #000000; font-weight: bold;">+</span> event<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * Add loaded swf to the display list
		 * @param	event
		 */</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> completeHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> main<span style="color: #000000; font-weight: bold;">:*</span> = event.<span style="color: #004993;">target</span>.<span style="color: #004993;">content</span>;
			TweenLite.from<span style="color: #000000;">&#40;</span>main, <span style="color: #000000; font-weight:bold;">1</span>, <span style="color: #000000;">&#123;</span> <span style="color: #004993;">alpha</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #004993;">delay</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #000000; font-weight:bold;">0.5</span>, onStart<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">addChildAt</span>, onStartParams<span style="color: #000000; font-weight: bold;">:</span><span style="color: #000000;">&#91;</span>main, <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#93;</span>, onComplete<span style="color: #000000; font-weight: bold;">:</span>destroy <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span>;
			setListeners<span style="color: #000000;">&#40;</span>main, <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * Remove Preloader
		 */</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> destroy<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>preloader <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> preloader.<span style="color: #004993;">parent</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				preloader.<span style="color: #004993;">parent</span>.<span style="color: #004993;">removeChild</span><span style="color: #000000;">&#40;</span>preloader<span style="color: #000000;">&#41;</span>;
				preloader = <span style="color: #0033ff; font-weight: bold;">null</span>;
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * Manage Loading Event Listeners
		 * @param	dispatcher
		 * @param	b
		 */</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> setListeners<span style="color: #000000;">&#40;</span>dispatcher<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">IEventDispatcher</span>, <span style="color: #004993;">b</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> state<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #004993;">b</span> <span style="color: #000000; font-weight: bold;">?</span> <span style="color: #990000;">&quot;addEventListener&quot;</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #990000;">&quot;removeEventListener&quot;</span>;
			dispatcher<span style="color: #000000;">&#91;</span>state<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">COMPLETE</span>, completeHandler<span style="color: #000000;">&#41;</span>;
			dispatcher<span style="color: #000000;">&#91;</span>state<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">IOErrorEvent</span>.<span style="color: #004993;">IO_ERROR</span>, ioErrorHandler<span style="color: #000000;">&#41;</span>;
			dispatcher<span style="color: #000000;">&#91;</span>state<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">ProgressEvent</span>.<span style="color: #004993;">PROGRESS</span>, progressHandler<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Main.as</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #3f5fbf;">/**
 * 	PV3D 2.0 Basic Example
 * 	@author Marco Di Giuseppe
 * 	marco (at) designmarco (dot) com
 * 	http://designmarco.com
 */</span>
<span style="color: #9900cc; font-weight: bold;">package</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">Event</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.view.BasicView;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.objects.primitives.Plane;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.materials.BitmapAssetMaterial;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> Main extends BasicView
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> plane<span style="color: #000000; font-weight: bold;">:</span>Plane;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">ADDED_TO_STAGE</span>, <span style="color: #004993;">init</span>, <span style="color: #0033ff; font-weight: bold;">false</span>, <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #009900;">// initialize pv3d scene</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span>event<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">ADDED_TO_STAGE</span>, <span style="color: #004993;">init</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			_camera.<span style="color: #004993;">focus</span> = <span style="color: #000000; font-weight:bold;">100</span>;
			_camera.<span style="color: #004993;">zoom</span>  = <span style="color: #000000; font-weight:bold;">11</span>;
&nbsp;
			<span style="color: #6699cc; font-weight: bold;">var</span> material<span style="color: #000000; font-weight: bold;">:</span>BitmapAssetMaterial = <span style="color: #0033ff; font-weight: bold;">new</span> BitmapAssetMaterial<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;image&quot;</span><span style="color: #000000;">&#41;</span>;
			material.smooth = <span style="color: #0033ff; font-weight: bold;">true</span>;
			material.doubleSided = <span style="color: #0033ff; font-weight: bold;">true</span>;
&nbsp;
			plane = <span style="color: #0033ff; font-weight: bold;">new</span> Plane<span style="color: #000000;">&#40;</span>material, <span style="color: #000000; font-weight:bold;">500</span>, <span style="color: #000000; font-weight:bold;">500</span>, <span style="color: #000000; font-weight:bold;">2</span>, <span style="color: #000000; font-weight:bold;">2</span><span style="color: #000000;">&#41;</span>;
			plane.pitch<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">20</span><span style="color: #000000;">&#41;</span>;
			scene.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>plane<span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">ENTER_FRAME</span>, <span style="color: #004993;">render</span>, <span style="color: #0033ff; font-weight: bold;">false</span>, <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #004993;">render</span><span style="color: #000000;">&#40;</span>event<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			plane.yaw<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0.75</span><span style="color: #000000;">&#41;</span>;
			singleRender<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.designmarco.com/2008/05/26/as3-pv3d-preloader/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Flash Actionscript Banner using Fuse Kit 2.1</title>
		<link>http://blog.designmarco.com/2007/07/02/fusebanner/</link>
		<comments>http://blog.designmarco.com/2007/07/02/fusebanner/#comments</comments>
		<pubDate>Tue, 03 Jul 2007 05:31:03 +0000</pubDate>
		<dc:creator>Marco</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[AS2]]></category>
		<category><![CDATA[Fuse Kit]]></category>

		<guid isPermaLink="false">http://blog.designmarco.com/2007/07/02/fusebanner/</guid>
		<description><![CDATA[I recently made a flash header for a client using the Fuse Animation Kit, and wanted to post this as a real world code example. The Fuse Kit is an incredible Event &#38; Animation Sequencer developed by Moses Gunesch. It&#8217;s currently only written as Actionscript 2.0 classes, but hopefully that&#8217;s going to change soon. This [...]]]></description>
			<content:encoded><![CDATA[<p>I recently made a flash header for a client using the Fuse Animation Kit, and wanted to post this as a real world code example. The <a href="http://mosessupposes.com/Fuse"  title="Fuse Kit Home Page" target="_blank">Fuse Kit</a> is an incredible <em>Event &amp; Animation Sequencer </em>developed by  Moses Gunesch. It&#8217;s currently only written as Actionscript 2.0 classes, but hopefully that&#8217;s going to change soon. This swf consists of nine images with smoothing enabled, all placed on the stage in the first frame. They&#8217;re also all on separate layers, and each given an instance name.</p>
<p><a href="http://blog.designmarco.com/swf/fusebanner.swf"  rel="lightbox" title="Fuse Kit Banner Animation">View Flash Banner</a></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/*
 * Copyright 2007 (c) Marco Di Giuseppe, http://designmarco.com
 *
 * 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, sub license, 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
 * NON INFRINGEMENT. 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.
 */</span>
<span style="color: #0066CC;">Stage</span>.<span style="color: #0066CC;">align</span> = <span style="color: #ff0000;">&quot;TL&quot;</span>;
<span style="color: #0066CC;">Stage</span>.<span style="color: #0066CC;">scaleMode</span> = <span style="color: #ff0000;">&quot;noScale&quot;</span>;
<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">mosesSupposes</span>.<span style="color: #006600;">fuse</span>.<span style="color: #66cc66;">*</span>;
ZigoEngine.<span style="color: #006600;">register</span><span style="color: #66cc66;">&#40;</span>Fuse,PennerEasing<span style="color: #66cc66;">&#41;</span>;
ZigoEngine.<span style="color: #006600;">ROUND_RESULTS</span> = <span style="color: #000000; font-weight: bold;">true</span>;
<span style="color: #0066CC;">_quality</span> = <span style="color: #ff0000;">&quot;HIGH&quot;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	wand_mc.<span style="color: #0066CC;">_visible</span> = <span style="color: #000000; font-weight: bold;">false</span>;
	wand_mc.<span style="color: #0066CC;">_x</span> = <span style="color: #cc66cc;">0</span>;
	wand_mc.<span style="color: #0066CC;">_y</span> = <span style="color: #cc66cc;">0</span>;
	logo_mc.<span style="color: #0066CC;">_x</span> = <span style="color: #cc66cc;">980</span>;
	logo_mc.<span style="color: #0066CC;">_y</span> = <span style="color: #cc66cc;">0</span>;
	a.<span style="color: #0066CC;">_visible</span> = <span style="color: #000000; font-weight: bold;">false</span>;
	b.<span style="color: #0066CC;">_visible</span> = <span style="color: #000000; font-weight: bold;">false</span>;
	c.<span style="color: #0066CC;">_visible</span> = <span style="color: #000000; font-weight: bold;">false</span>;
	d.<span style="color: #0066CC;">_visible</span> = <span style="color: #000000; font-weight: bold;">false</span>;
	a.<span style="color: #0066CC;">_x</span> = -<span style="color: #cc66cc;">44</span>;
	a.<span style="color: #0066CC;">_y</span> = <span style="color: #cc66cc;">0</span>;
	b.<span style="color: #0066CC;">_x</span> = <span style="color: #cc66cc;">0</span>;
	b.<span style="color: #0066CC;">_y</span> = -<span style="color: #cc66cc;">92</span>;
	c.<span style="color: #0066CC;">_x</span> = <span style="color: #cc66cc;">0</span>;
	c.<span style="color: #0066CC;">_y</span> = -<span style="color: #cc66cc;">241</span>;
	d.<span style="color: #0066CC;">_x</span> = <span style="color: #cc66cc;">0</span>;
	d.<span style="color: #0066CC;">_y</span> = <span style="color: #cc66cc;">0</span>;
	atxt_mc.<span style="color: #0066CC;">_x</span> = <span style="color: #cc66cc;">420</span>;
	atxt_mc.<span style="color: #0066CC;">_y</span> = <span style="color: #cc66cc;">50</span>;
	vdude_mc.<span style="color: #0066CC;">_visible</span> = <span style="color: #000000; font-weight: bold;">false</span>;
	vdude_mc.<span style="color: #0066CC;">_x</span> = <span style="color: #0066CC;">Stage</span>.<span style="color: #0066CC;">width</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">2</span>-<span style="color: #cc66cc;">250</span>;
	vdude_mc.<span style="color: #0066CC;">_y</span> = <span style="color: #cc66cc;">25</span>;
	vdude2_mc.<span style="color: #0066CC;">_visible</span> = <span style="color: #000000; font-weight: bold;">false</span>;
	vdude2_mc.<span style="color: #0066CC;">_x</span> = <span style="color: #0066CC;">Stage</span>.<span style="color: #0066CC;">width</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">2</span>-<span style="color: #cc66cc;">50</span>;
	vdude2_mc.<span style="color: #0066CC;">_y</span> = <span style="color: #cc66cc;">5</span>;
	van_mc.<span style="color: #0066CC;">_x</span> = <span style="color: #cc66cc;">980</span>;
	van_mc.<span style="color: #0066CC;">_y</span> = <span style="color: #cc66cc;">25</span>;
	bigfuse<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> bigfuse<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> f = <span style="color: #000000; font-weight: bold;">new</span> Fuse<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	f.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">target</span>:logo_mc, y:<span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">round</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">20</span><span style="color: #66cc66;">&#41;</span>, x:<span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">round</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span>, start_scale:<span style="color: #cc66cc;">0</span>, extra1:<span style="color: #cc66cc;">1.2</span>, ease:<span style="color: #ff0000;">'easeOutBack'</span>, <span style="color: #0066CC;">time</span>:.8<span style="color: #66cc66;">&#125;</span>, <span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">target</span>:atxt_mc, start_fade:<span style="color: #cc66cc;">0</span>, x:<span style="color: #ff0000;">'30'</span>, y:<span style="color: #ff0000;">'-30'</span>, ease:<span style="color: #ff0000;">'easeOutQuart'</span>, <span style="color: #0066CC;">time</span>:<span style="color: #cc66cc;">1</span>, delay:.8<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
	f.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>delay:.7<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
	f.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">target</span>:logo_mc, fade:<span style="color: #cc66cc;">0</span>, <span style="color: #0066CC;">time</span>:<span style="color: #cc66cc;">1.5</span>, ease:<span style="color: #ff0000;">'easeInOutExpo'</span><span style="color: #66cc66;">&#125;</span>, <span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">target</span>:atxt_mc, fade:<span style="color: #cc66cc;">0</span>, ease:<span style="color: #ff0000;">'easeOutQuart'</span>, <span style="color: #0066CC;">time</span>:<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#125;</span>, <span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">target</span>:a, start_fade:<span style="color: #cc66cc;">0</span>, x:<span style="color: #cc66cc;">0</span>, y:<span style="color: #ff0000;">'-225'</span>, <span style="color: #0066CC;">time</span>:<span style="color: #cc66cc;">3</span>, ease:<span style="color: #ff0000;">'easeInOutQuart'</span>, trigger:<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
	f.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">target</span>:b, start_fade:<span style="color: #cc66cc;">0</span>, y:<span style="color: #cc66cc;">0</span>, <span style="color: #0066CC;">time</span>:<span style="color: #cc66cc;">3</span>, ease:<span style="color: #ff0000;">'easeInOutQuart'</span>, trigger:<span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
	f.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">target</span>:a, fade:<span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#125;</span>, <span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">target</span>:d, start_fade:<span style="color: #cc66cc;">0</span>, y:<span style="color: #ff0000;">'-400'</span>, x:<span style="color: #ff0000;">'-100'</span>, ease:<span style="color: #ff0000;">'easeOutQuart'</span>, scale:<span style="color: #cc66cc;">200</span>, <span style="color: #0066CC;">time</span>:<span style="color: #cc66cc;">3</span>, trigger:<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
	f.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">target</span>:b, fade:<span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#125;</span>, <span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">target</span>:c, start_fade:<span style="color: #cc66cc;">0</span>, y:<span style="color: #ff0000;">'200'</span>, scale:<span style="color: #cc66cc;">120</span>, ease:<span style="color: #ff0000;">'easeOutQuart'</span>, <span style="color: #0066CC;">time</span>:<span style="color: #cc66cc;">2</span>, trigger:<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
	f.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">target</span>:d, fade:<span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#125;</span>, <span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">target</span>:c, brightOffset:<span style="color: #cc66cc;">100</span>, <span style="color: #0066CC;">time</span>:<span style="color: #cc66cc;">2</span>, ease:<span style="color: #ff0000;">'easeOutExpo'</span>, trigger:<span style="color: #cc66cc;">1.5</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
	f.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">target</span>:c, fade:<span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#125;</span>, <span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">target</span>:van_mc, x:<span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">round</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">50</span><span style="color: #66cc66;">&#41;</span>, ease:<span style="color: #ff0000;">'easeOutExpo'</span>, <span style="color: #0066CC;">time</span>:<span style="color: #cc66cc;">3</span>, trigger:<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
	f.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">target</span>:vdude_mc, fade:<span style="color: #cc66cc;">100</span>, start_scale:<span style="color: #cc66cc;">0</span>, scale:<span style="color: #cc66cc;">75</span>, x:<span style="color: #0066CC;">Stage</span>.<span style="color: #0066CC;">width</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">2</span>-<span style="color: #cc66cc;">50</span>, y:<span style="color: #cc66cc;">8</span>, ease:<span style="color: #ff0000;">'easeOutQuart'</span>, <span style="color: #0066CC;">time</span>:<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
	f.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">target</span>:vdude_mc, start_fade:<span style="color: #cc66cc;">100</span>, <span style="color: #0066CC;">time</span>:<span style="color: #cc66cc;">2</span>, ease:<span style="color: #ff0000;">'easeOutQuad'</span><span style="color: #66cc66;">&#125;</span>, <span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">target</span>:vdude2_mc, x:<span style="color: #0066CC;">Stage</span>.<span style="color: #0066CC;">width</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">2</span>-<span style="color: #cc66cc;">50</span>, start_fade:<span style="color: #cc66cc;">0</span>, <span style="color: #0066CC;">time</span>:<span style="color: #cc66cc;">2</span>, ease:<span style="color: #ff0000;">'easeOutExpo'</span><span style="color: #66cc66;">&#125;</span>, <span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">target</span>:btxt_mc, start_fade:<span style="color: #cc66cc;">0</span>, delay:<span style="color: #cc66cc;">1</span>, <span style="color: #0066CC;">time</span>:<span style="color: #cc66cc;">1</span>, start_x:<span style="color: #cc66cc;">580</span>, x:<span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">ceil</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">610</span><span style="color: #66cc66;">&#41;</span>, start_y:<span style="color: #cc66cc;">60</span>, y:<span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">ceil</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">30</span><span style="color: #66cc66;">&#41;</span>, ease:<span style="color: #ff0000;">'easeOutQuart'</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
	f.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">target</span>:wand_mc, start_fade:<span style="color: #cc66cc;">0</span>, delay:<span style="color: #cc66cc;">1</span>, <span style="color: #0066CC;">time</span>:<span style="color: #cc66cc;">3</span>, ease:<span style="color: #ff0000;">'easeOutQuart'</span><span style="color: #66cc66;">&#125;</span>, <span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">target</span>:van_mc, ease:<span style="color: #ff0000;">'easeOutSine'</span>, start_fade:<span style="color: #cc66cc;">100</span>, <span style="color: #0066CC;">time</span>:<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#125;</span>, <span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">target</span>:vdude2_mc, start_fade:<span style="color: #cc66cc;">100</span>, ease:<span style="color: #ff0000;">'easeOutSine'</span>, <span style="color: #0066CC;">time</span>:<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#125;</span>, <span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">target</span>:logo_mc, fade:<span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
	f.<span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">stop</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.designmarco.com/2007/07/02/fusebanner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Encoding NTSC Video to FLV for the internet</title>
		<link>http://blog.designmarco.com/2007/07/01/ntsc_video_to_flv/</link>
		<comments>http://blog.designmarco.com/2007/07/01/ntsc_video_to_flv/#comments</comments>
		<pubDate>Sun, 01 Jul 2007 08:44:56 +0000</pubDate>
		<dc:creator>Marco</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[FLV]]></category>

		<guid isPermaLink="false">http://blog.designmarco.com/2007/07/01/ntsc_video_to_flv/</guid>
		<description><![CDATA[designmarco video encoding Computer monitors display square pixels with a 1:1 ratio,  projected one after another as “progressive” images. NTSC video consists of horizontal lines displayed as two separate &#8220;interlaced&#8221; fields. Most people have a screen resolution of 1024 x 768, which is your typical notebook computer with a 15-inch screen. Unfortunately, the actual view-port [...]]]></description>
			<content:encoded><![CDATA[<h2 align="center">designmarco video encoding</h2>
<p>Computer monitors display square pixels with a 1:1 ratio,  projected one after another as “progressive” images.</p>
<p>NTSC video consists of horizontal lines displayed as two separate &#8220;interlaced&#8221; fields.</p>
<p>Most people have a screen resolution of 1024 x 768, which is your typical notebook computer with a 15-inch screen. Unfortunately, the actual view-port is considerably smaller depending on the browser settings.</p>
<p>I have found that 480&#215;360 is a comfortable size, and leaves enough space around the video to breathe.</p>
<p>File size however is completely subjective, and handled much differently over different connection speeds. If the data rate of the video is encoded at a rate faster than it can be transferred, you will experience stuttering, and extremely choppy playback.</p>
<p>When encoding flash video I typically keep it around 700bps, and always use the On2 v6 encoding option. The final size of the .flv should ideally be under 5mb, and can even be as large as 10mb. Anything larger than 10mb will take longer than anyone is willing to wait. On the bright side, once a video is loaded, it remains in the browser cache. This means it will play instantly upon second viewing. Another option is to provide a download link, so they can view the video on their computer. In this case the video should remain as a QuickTime .mov, and not be encoded to flash video.</p>
<p><strong>Convert DV to 4&#215;3 (square pixel)</strong></p>
<ol>
<li>Capture at 720 x 480 pixels.</li>
<li> De-interlace using Gaussian Blur Blend Fields.</li>
<li>Crop eight pixels from the left and right sides (so it&#8217;s 704 x 480).</li>
<li>Resize the video to 640 x 480 and set pixel aspect ratio set to 1:1 square.</li>
<li>Export video using the Animation codec that does not use any compression. (Some programs allow      you to skip this step, and export the file with the correct pixel aspect ratio the first time)</li>
<li>Open the new file, re-size to 480 x 360, and export with Sorenson 3 compression.</li>
<li>Import into flash and encode using the On2V6 codec with a 700bps data rate. (higher data rates will create files too large to play over the internet)</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.designmarco.com/2007/07/01/ntsc_video_to_flv/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Custom FLV Skins</title>
		<link>http://blog.designmarco.com/2007/05/01/custom-flv-skins/</link>
		<comments>http://blog.designmarco.com/2007/05/01/custom-flv-skins/#comments</comments>
		<pubDate>Tue, 01 May 2007 21:54:53 +0000</pubDate>
		<dc:creator>Marco</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[FLV]]></category>
		<category><![CDATA[FLV Skins]]></category>

		<guid isPermaLink="false">http://blog.designmarco.com/2007/05/01/custom-flv-skins/</guid>
		<description><![CDATA[Here are two custom skins I designed for the Flash 8 FLVplayback component. I&#8217;ve also included the source .fla so you can further customize your own flv skins. Enjoy download gorilla skin download ravenous skin]]></description>
			<content:encoded><![CDATA[<p>Here are two custom skins I designed for the Flash 8 FLVplayback component. I&#8217;ve also included the source .fla so you can further customize your own flv skins.  Enjoy</p>
<p><img src="http://blog.designmarco.com/wp-content/uploads/2007/05/gorilla.png" alt="gorilla skin" /></p>
<p><a href="http://blog.designmarco.com/download-manager.php?id=1"  target="_blank" title="gorilla skin download"> download gorilla skin</a></p>
<p><img src="http://blog.designmarco.com/wp-content/uploads/2007/05/ravenous.png" alt="ravenous skin" /></p>
<p><a href="http://blog.designmarco.com/download-manager.php?id=2"  target="_blank" title="ravenous skin">download ravenous skin</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.designmarco.com/2007/05/01/custom-flv-skins/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Explanation of the Blend Modes</title>
		<link>http://blog.designmarco.com/2007/04/28/explanation-of-the-blend-modes/</link>
		<comments>http://blog.designmarco.com/2007/04/28/explanation-of-the-blend-modes/#comments</comments>
		<pubDate>Sat, 28 Apr 2007 07:03:23 +0000</pubDate>
		<dc:creator>Marco</dc:creator>
				<category><![CDATA[Design]]></category>

		<guid isPermaLink="false">http://blog.designmarco.com/2007/04/28/explanation-of-the-blend-modes/</guid>
		<description><![CDATA[I’ve always thought it was important to understand how the blendModes operate. So here are text book answers to their function, straight from the Adobe LiveDocs. normal- The button appears in front of the background. Pixel values of the button override those of the background. Where the button is transparent, the background is visible. layer- [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve always thought it was important to understand how the blendModes operate.  So here are text book answers to their function, straight from the <a rel="nofollow" href="http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&amp;file=00002444.html"  title="Adobe LiveDocs" target="_blank">Adobe LiveDocs</a>.</p>
<ol>
<li><span style="font-weight: bold">normal</span>- The button appears in front of the background. Pixel values of the button override those of the background. Where the button is transparent, the background is visible.</li>
<li><span style="font-weight: bold">layer</span>- Forces the creation of a temporary buffer for precomposition for the button. This is done automatically if there is more than one child object in a button and a blendMode setting other than &#8220;normal&#8221; is selected for the child.</li>
<li><span style="font-weight: bold">multiply</span>- Multiplies the values of the button constituent colors by those of the background color, and then normalizes by dividing by 0xFF, resulting in darker colors. This is commonly used for shadows and depth effects. For example, if a constituent color (such as red) of one pixel in the button and the corresponding color of the pixel in the background both have the value 0&#215;88, the multiplied result is 0&#215;4840. Dividing by 0xFF yields a value of 0&#215;48 for that constituent color, which is a darker shade than that of the button or that of the background.</li>
<li><span style="font-weight: bold">screen</span>- Multiplies the complement (inverse) of the button color by the complement of the background color, resulting in a bleaching effect. This setting is commonly used for highlights or to remove black areas of the button.</li>
<li><span style="font-weight: bold">lighten</span>- Selects the lighter of the constituent colors of the button and those of the background (the ones with the larger values). This setting is commonly used for superimposing type. For example, if the button has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, then the resulting RGB value for the displayed pixel is 0xFFF833 (because 0xFF &gt; 0xDD, 0xCC &lt; 0xF8, and 0&#215;33 &gt; 0&#215;00 = 33).</li>
<li><span style="font-weight: bold">darken</span>- Selects the darker of the constituent colors of the button and those of the background (the ones with the smaller values). This setting is commonly used for superimposing type. For example, if the button has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the resulting RGB value for the displayed pixel is 0xDDCC00 (because 0xFF &gt; 0xDD, 0xCC &lt; 0xF8, and 0&#215;33 &gt; 0&#215;00 = 33).</li>
<li><span style="font-weight: bold">difference</span>- Compares the constituent colors of the button with those of its background, and subtracts the darker of the two constituent colors from the lighter one. This setting is commonly used for more vibrant colors. For example, if the button has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the resulting RGB value for the displayed pixel is 0x222C33 (because 0xFF &#8211; 0xDD = 0&#215;22, 0xF8 &#8211; 0xCC = 0x2C, and 0&#215;33 &#8211; 0&#215;00 = 0&#215;33)</li>
<li><span style="font-weight: bold">add</span>- Adds the values of the constituent colors of the button to those of its background, and applies a ceiling of 0xFF. This setting is commonly used for animating a lightening dissolve between two objects. For example, if the button has a pixel with an RGB value of 0xAAA633, and the background pixel has an RGB value of 0xDD2200, the resulting RGB value for the displayed pixel is 0xFFC833 (because 0xAA + 0xDD &gt; 0xFF, 0xA6 + 0&#215;22 = 0xC8, and 0&#215;33 + 0&#215;00 = 0&#215;33).</li>
<li><span style="font-weight: bold">subtract</span>-Subtracts the value of the constituent colors in the button from those of the background, and applies a floor of 0. This setting is commonly used for animating a darkening dissolve between two objects. For example, if the button has a pixel with an RGB value of 0xAA2233, and the background pixel has an RGB value of 0xDDA600, the resulting RGB value for the displayed pixel is 0&#215;338400 (because 0xDD &#8211; 0xAA = 0&#215;33, 0xA6 &#8211; 0&#215;22 = 0&#215;84, and 0&#215;00 &#8211; 0&#215;33 &lt; 0&#215;00).</li>
<li> <span style="font-weight: bold">invert</span>- Inverts the background.</li>
<li><span style="font-weight: bold">alpha</span>- Applies the alpha value of each pixel of the button to the background. This requires the &#8220;layer&#8221; blendMode to be applied to a parent button. For example, in the illustration, the parent button, which is a white background has blendMode = &#8220;layer&#8221;.</li>
<li><span style="font-weight: bold">erase</span>- Erases the background based on the alpha value of the button. This requires the layer blendMode setting to be applied to a parent button. For example, in the illustration, the parent button, which is a white background, has blendMode=&#8221;layer&#8221;.</li>
<li><span style="font-weight: bold">overlay</span>- Adjusts the color of each bitmap based on the darkness of the background. If the background is lighter than 50% gray, the button and background colors are screened, which results in a lighter color. If the background is darker than 50% gray, the colors are multiplied, which results in a darker color. This setting is commonly used for shading effects.</li>
<li><span style="font-weight: bold">hardlight</span>- Adjusts the color of each bitmap based on the darkness of the button. If the button is lighter than 50% gray, the button and background colors are screened, which results in a lighter color. If the button is darker than 50% gray, the colors are multiplied, which results in a darker color. This setting is commonly used for shading effects.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.designmarco.com/2007/04/28/explanation-of-the-blend-modes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fuse</title>
		<link>http://blog.designmarco.com/2007/04/13/fuse/</link>
		<comments>http://blog.designmarco.com/2007/04/13/fuse/#comments</comments>
		<pubDate>Fri, 13 Apr 2007 17:43:10 +0000</pubDate>
		<dc:creator>Marco</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Fuse Kit]]></category>

		<guid isPermaLink="false">http://blog.designmarco.com/2007/04/13/fuse/</guid>
		<description><![CDATA[I used to animate on the time line, and then I discovered Fuse Kit, the ultimate animation engine. This open source project is led by Moses Gunesch, who continues to develop the kit, and constantly push the boundaries of scripted motion. Visit  Fuse Website 1 2 import com.mosesSupposes.fuse.*; ZigoEngine.register&#40; Fuse, PennerEasing &#41;;]]></description>
			<content:encoded><![CDATA[<p>I used to animate on the time line, and then I discovered Fuse Kit, the ultimate animation engine. This open source project is led by Moses Gunesch, who continues to develop the kit, and constantly push the boundaries of scripted motion. Visit  <a href="http://www.mosessupposes.com/Fuse/index.html" >Fuse Website</a></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> com.<span style="color: #006600;">mosesSupposes</span>.<span style="color: #006600;">fuse</span>.<span style="color: #66cc66;">*</span>;
ZigoEngine.<span style="color: #006600;">register</span><span style="color: #66cc66;">&#40;</span> Fuse, PennerEasing <span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.designmarco.com/2007/04/13/fuse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss><!-- Dynamic Page Served (once) in 2.012 seconds -->
