<?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>FLEX{er} &#187; Tweening</title>
	<atom:link href="http://www.flexer.info/category/tweening/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.flexer.info</link>
	<description>flex developers web corner</description>
	<lastBuildDate>Tue, 04 Oct 2011 16:23:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<image>
  <link>http://www.flexer.info</link>
  <url>http://www.flexer.info/favicon.ico</url>
  <title>FLEX{er}</title>
</image>
		<item>
		<title>Tweensy &#8211; Tweening &amp; Effects Library &#8211; Includes Particles Generator Engine</title>
		<link>http://www.flexer.info/2009/05/01/tweensy-tweening-effects-library-includes-particles-generator-engine/</link>
		<comments>http://www.flexer.info/2009/05/01/tweensy-tweening-effects-library-includes-particles-generator-engine/#comments</comments>
		<pubDate>Fri, 01 May 2009 00:32:36 +0000</pubDate>
		<dc:creator>Andrei Ionescu</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Libraries]]></category>
		<category><![CDATA[Tweening]]></category>
		<category><![CDATA[library]]></category>

		<guid isPermaLink="false">http://www.flexer.info/?p=704</guid>
		<description><![CDATA[This week I&#8217;ve been searching for a tweening library. Previously I&#8217;ve been using more than one tween library like: TweenMax, TweenLight, Tweener, GTween, Adobe&#8217;s Tween, etc.
But I found about a new tweening library called Tweensy by Shane McCartney on Lost In Actionscript blog.
If you wonder what is new to this tweening library, well&#8230;

A Bitmap rendering [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-right: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.flexer.info%2F2009%2F05%2F01%2Ftweensy-tweening-effects-library-includes-particles-generator-engine%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.flexer.info%2F2009%2F05%2F01%2Ftweensy-tweening-effects-library-includes-particles-generator-engine%2F" height="61" width="51" /></a></div><div style="float: right; margin-right: 10px"><a class="google_buzz"  
href="http://www.google.com/reader/link?url=http://www.flexer.info/2009/05/01/tweensy-tweening-effects-library-includes-particles-generator-engine/&title=Tweensy+&#8211;+Tweening+&#038;+Effects+Library+&#8211;+Includes+Particles+Generator+Engine&srcURL=http://www.flexer.info" target="_blank" rel="nofollow"><img
src="http://www.flexer.info/wp-content/plugins/google-buzz-button-for-wordpress/images/google-buzz.png" alt="Google Buzz" /></a></div><p>This week I&#8217;ve been searching for a tweening library. Previously I&#8217;ve been using more than one tween library like: <a href="http://blog.greensock.com/tweenmaxas3/" target="_blank">TweenMax</a>, <a href="http://blog.greensock.com/tweenliteas3/" target="_blank">TweenLight</a>, <a href="http://code.google.com/p/tweener/" target="_blank">Tweener</a>, <a href="http://www.gskinner.com/libraries/gtween/" target="_blank">GTween</a>, Adobe&#8217;s Tween, etc.</p>
<p><img src="http://www.flexer.info/wp-content/uploads/2009/04/tweensy2.jpg" alt="tweensy2" title="tweensy2" width="350" height="222" align="right" hspace="15" />But I found about a new tweening library called <a href="http://code.google.com/p/tweensy/" target="_blank">Tweensy</a> by Shane McCartney on <a href="http://www.lostinactionscript.com/blog/index.php/2008/08/31/as3-tween-engine-tweensy-preview/" target="_blank">Lost In Actionscript blog</a>.</p>
<p>If you wonder what is new to this tweening library, well&#8230;</p>
<ul class="ul">
<li>A Bitmap rendering feature allowing for Bitmap Effects not easily achieved from the Adobe filter set such as Directional Motion Blur, Liquid Theshold, Directional Displacement and Buldge/Skew Displacement</li>
<li>Particle Emitters to generate smoke, fire, abstract, and magical effects from your motion tweens</li>
<li>Vector shape Tweening</li>
<li>Gradient Tweening</li>
</ul>
<p>I&#8217;ve playing with it a little bit and the particle generation module is working very well. Although the examples provided with the library are for Flash I&#8217;ve been able to generate a fire in Flex, based on an example found in there.</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_tweensyexampleapp_1271819331"
			class="flashmovie"
			width="600"
			height="400">
	<param name="movie" value="/wp-content/uploads/2009/04/tweensyexampleapp.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/wp-content/uploads/2009/04/tweensyexampleapp.swf"
			name="fm_tweensyexampleapp_1271819331"
			width="600"
			height="400">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>With the particle generator nice effects can be achieved and integrated in different components. For example, a button that will be on fire at rollover and many, many other.</p>
<p>Now that you&#8217;ve seen the fire take a look into the code:</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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&lt;</span>?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;</span>mx:Application xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> layout=<span style="color: #ff0000;">&quot;absolute&quot;</span>
    <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;600&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;400&quot;</span>
    creationComplete=<span style="color: #ff0000;">&quot;create()&quot;</span>
    updateComplete=<span style="color: #ff0000;">&quot;update()&quot;</span><span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>mx:Canvas id=<span style="color: #ff0000;">&quot;mainCanvas&quot;</span> x=<span style="color: #ff0000;">&quot;0&quot;</span> y=<span style="color: #ff0000;">&quot;0&quot;</span>
        <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;600&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;400&quot;</span><span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>mx:UIComponent id=<span style="color: #ff0000;">&quot;myUIComponent&quot;</span> 
            x=<span style="color: #ff0000;">&quot;0&quot;</span> y=<span style="color: #ff0000;">&quot;0&quot;</span>
            <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;600&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;400&quot;</span> <span style="color: #66cc66;">/&gt;</span>
        <span style="color: #66cc66;">&lt;</span>mx:<span style="color: #0066CC;">Button</span> id=<span style="color: #ff0000;">&quot;myButton&quot;</span> horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> y=<span style="color: #ff0000;">&quot;300&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;120&quot;</span><span style="color: #66cc66;">/&gt;</span>
    <span style="color: #66cc66;">&lt;/</span>mx:Canvas<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>mx:Script<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;!</span><span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span>
            <span style="color: #808080; font-style: italic;">// imports</span>
            <span style="color: #0066CC;">import</span> com.<span style="color: #006600;">flashdynamix</span>.<span style="color: #006600;">motion</span>.<span style="color: #006600;">effects</span>.<span style="color: #006600;">core</span>.<span style="color: #006600;">ColorEffect</span>;
            <span style="color: #0066CC;">import</span> com.<span style="color: #006600;">flashdynamix</span>.<span style="color: #006600;">motion</span>.<span style="color: #006600;">effects</span>.<span style="color: #006600;">core</span>.<span style="color: #006600;">FilterEffect</span>;
            <span style="color: #0066CC;">import</span> com.<span style="color: #006600;">flashdynamix</span>.<span style="color: #006600;">motion</span>.<span style="color: #006600;">extras</span>.<span style="color: #006600;">Emitter</span>;
            <span style="color: #0066CC;">import</span> com.<span style="color: #006600;">flashdynamix</span>.<span style="color: #006600;">motion</span>.<span style="color: #006600;">effects</span>.<span style="color: #006600;">PerlinDisplacementEffect</span>;
            <span style="color: #0066CC;">import</span> com.<span style="color: #006600;">flashdynamix</span>.<span style="color: #006600;">motion</span>.<span style="color: #006600;">layers</span>.<span style="color: #006600;">BitmapLayer</span>;
&nbsp;
            <span style="color: #808080; font-style: italic;">// bitmap layer that will hold and add all effect and</span>
            <span style="color: #808080; font-style: italic;">// filters needed </span>
            <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _layer:BitmapLayer;
            <span style="color: #808080; font-style: italic;">// color transformation</span>
            <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _colorTransform:ColorTransform;
            <span style="color: #808080; font-style: italic;">// displacement effect</span>
            <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _displacementEffect:PerlinDisplacementEffect;
            <span style="color: #808080; font-style: italic;">// our emitter which will generate particles</span>
            <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _emitter:Emitter;
            <span style="color: #808080; font-style: italic;">// another two effects</span>
            <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _filterEffect:FilterEffect;
            <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _colorEffect:ColorEffect;
            <span style="color: #808080; font-style: italic;">// fire particle model</span>
            <span style="color: #808080; font-style: italic;">// emitter will generate particles based on it</span>
            <span style="color: #66cc66;">&#91;</span>Embed<span style="color: #66cc66;">&#40;</span>source=<span style="color: #ff0000;">&quot;assets/images/fire.png&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>
            <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _fireParticle:<span style="color: #000000; font-weight: bold;">Class</span>;
&nbsp;
            <span style="color: #808080; font-style: italic;">// button labels</span>
            <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _startFireText:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;Start the fire!&quot;</span>;
            <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _endFireText:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;Stop the fire!&quot;</span>;
&nbsp;
            <span style="color: #808080; font-style: italic;">// create method</span>
            <span style="color: #808080; font-style: italic;">// called before all objects are added to stage</span>
            <span style="color: #808080; font-style: italic;">// stage is not available when this method is called</span>
            <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> create<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
            <span style="color: #66cc66;">&#123;</span>
                myButton.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">CLICK</span>, startFire<span style="color: #66cc66;">&#41;</span>;
                myButton.<span style="color: #006600;">label</span> = _startFireText;
                <span style="color: #808080; font-style: italic;">// setting up the fire effect but not showing it</span>
                createFire<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
            <span style="color: #66cc66;">&#125;</span>    
&nbsp;
            <span style="color: #808080; font-style: italic;">// update method</span>
            <span style="color: #808080; font-style: italic;">// this will be called when all objects are added to stage</span>
            <span style="color: #808080; font-style: italic;">// stage is available at the moment this method is called</span>
            <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> update<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
            <span style="color: #66cc66;">&#123;</span>
                <span style="color: #808080; font-style: italic;">// setting the quality to low</span>
                <span style="color: #808080; font-style: italic;">// making it higher will overload the processor</span>
                <span style="color: #808080; font-style: italic;">// and because of heavy calculation artefact may appear</span>
                <span style="color: #0066CC;">stage</span>.<span style="color: #0066CC;">quality</span> = StageQuality.<span style="color: #006600;">LOW</span>;
            <span style="color: #66cc66;">&#125;</span>
&nbsp;
            <span style="color: #808080; font-style: italic;">// creating the fire</span>
            <span style="color: #808080; font-style: italic;">// setting it up</span>
            <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> createFire<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
            <span style="color: #66cc66;">&#123;</span>
                <span style="color: #808080; font-style: italic;">// width</span>
                <span style="color: #000000; font-weight: bold;">var</span> tW:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">600</span>;
                <span style="color: #808080; font-style: italic;">// height </span>
                <span style="color: #000000; font-weight: bold;">var</span> tH:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">400</span>;
                <span style="color: #808080; font-style: italic;">// scale </span>
                <span style="color: #000000; font-weight: bold;">var</span> tS:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">2</span>;
&nbsp;
                <span style="color: #808080; font-style: italic;">// creating bitmap layer</span>
                _layer = <span style="color: #000000; font-weight: bold;">new</span> BitmapLayer<span style="color: #66cc66;">&#40;</span>tW,tH,tS<span style="color: #66cc66;">&#41;</span>;
                <span style="color: #808080; font-style: italic;">// creating displacement effect</span>
                _displacementEffect = 
                    <span style="color: #000000; font-weight: bold;">new</span> PerlinDisplacementEffect<span style="color: #66cc66;">&#40;</span>tW<span style="color: #66cc66;">/</span><span style="color: #cc66cc;">2</span>,tH<span style="color: #66cc66;">/</span><span style="color: #cc66cc;">2</span>,tS,-<span style="color: #cc66cc;">6</span>,<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
                _displacementEffect.<span style="color: #006600;">baseX</span> = <span style="color: #cc66cc;">50</span>;
                _displacementEffect.<span style="color: #006600;">baseY</span> = <span style="color: #cc66cc;">40</span>;
                <span style="color: #808080; font-style: italic;">// creating filter effect</span>
                _filterEffect = <span style="color: #000000; font-weight: bold;">new</span> FilterEffect<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> BlurFilter<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">3</span>,<span style="color: #cc66cc;">3</span>,<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
                <span style="color: #808080; font-style: italic;">// creating color effect</span>
                _colorEffect = <span style="color: #000000; font-weight: bold;">new</span> ColorEffect<span style="color: #66cc66;">&#40;</span>
                    <span style="color: #000000; font-weight: bold;">new</span> ColorTransform<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span>,<span style="color: #cc66cc;">1</span>,<span style="color: #cc66cc;">1</span>,<span style="color: #cc66cc;">0.95</span>,-<span style="color: #cc66cc;">20</span>,-<span style="color: #cc66cc;">20</span>,-<span style="color: #cc66cc;">20</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
                <span style="color: #808080; font-style: italic;">// adding the above effects to bitmap layer</span>
                _layer.<span style="color: #0066CC;">add</span><span style="color: #66cc66;">&#40;</span>_displacementEffect<span style="color: #66cc66;">&#41;</span>;
                _layer.<span style="color: #0066CC;">add</span><span style="color: #66cc66;">&#40;</span>_filterEffect<span style="color: #66cc66;">&#41;</span>;
                _layer.<span style="color: #0066CC;">add</span><span style="color: #66cc66;">&#40;</span>_colorEffect<span style="color: #66cc66;">&#41;</span>;
                <span style="color: #808080; font-style: italic;">// creating color transformation</span>
                _colorTransform = <span style="color: #000000; font-weight: bold;">new</span> ColorTransform<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">1</span>,<span style="color: #cc66cc;">80</span>,<span style="color: #cc66cc;">30</span>,<span style="color: #cc66cc;">15</span><span style="color: #66cc66;">&#41;</span>;
                <span style="color: #808080; font-style: italic;">// creating the emitter that will generate particles</span>
                _emitter = <span style="color: #000000; font-weight: bold;">new</span> Emitter<span style="color: #66cc66;">&#40;</span>
                    _fireParticle, <span style="color: #808080; font-style: italic;">// our particle</span>
                    <span style="color: #66cc66;">&#123;</span>
                        rotation: <span style="color: #ff0000;">&quot;-22, 44&quot;</span>, <span style="color: #808080; font-style: italic;">// rotation: starting from -22 deg </span>
                                             <span style="color: #808080; font-style: italic;">// and having an interval of 44 deg</span>
                        scaleX: tS,
                        scaleY: tS
                    <span style="color: #66cc66;">&#125;</span>, <span style="color: #808080; font-style: italic;">// target's properties</span>
                    <span style="color: #cc66cc;">2</span>, <span style="color: #808080; font-style: italic;">// frequency: how many particles are created on each frame</span>
                    <span style="color: #cc66cc;">1</span>, <span style="color: #808080; font-style: italic;">// random: how often the particles are created</span>
                    <span style="color: #ff0000;">&quot;255, 285&quot;</span>, <span style="color: #808080; font-style: italic;">// angle: allowed movement angle</span>
                    <span style="color: #ff0000;">&quot;5, 60&quot;</span>, <span style="color: #808080; font-style: italic;">// distance: allowed distance</span>
                    <span style="color: #cc66cc;">0.5</span>, <span style="color: #808080; font-style: italic;">// speed: time (in sec) to reach destination</span>
                    BlendMode.<span style="color: #0066CC;">ADD</span> <span style="color: #808080; font-style: italic;">// blend mode</span>
                <span style="color: #66cc66;">&#41;</span>;
                <span style="color: #808080; font-style: italic;">// adding color tranformation</span>
                _emitter.<span style="color: #006600;">transform</span>.<span style="color: #006600;">colorTransform</span> = _colorTransform;
                <span style="color: #808080; font-style: italic;">// setting the emitter's scale</span>
                _emitter.<span style="color: #006600;">scale</span> = <span style="color: #cc66cc;">0.2</span>;
                <span style="color: #808080; font-style: italic;">// setting x &amp; y position</span>
                _emitter.<span style="color: #006600;">x</span> = <span style="color: #cc66cc;">300</span> - <span style="color: #cc66cc;">20</span>;
                _emitter.<span style="color: #006600;">y</span> = <span style="color: #cc66cc;">150</span>;
                <span style="color: #808080; font-style: italic;">// drawing the bitmap layer</span>
                _layer.<span style="color: #006600;">draw</span><span style="color: #66cc66;">&#40;</span>_emitter.<span style="color: #006600;">holder</span><span style="color: #66cc66;">&#41;</span>;
                <span style="color: #808080; font-style: italic;">// stoping rendering</span>
                _layer.<span style="color: #006600;">stopRender</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
                <span style="color: #808080; font-style: italic;">// hidding the effect</span>
                myUIComponent.<span style="color: #0066CC;">visible</span> = <span style="color: #000000; font-weight: bold;">false</span>;
                <span style="color: #808080; font-style: italic;">// adding the bitmap layer to our object holder</span>
                myUIComponent.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>_layer<span style="color: #66cc66;">&#41;</span>;
            <span style="color: #66cc66;">&#125;</span>
&nbsp;
            <span style="color: #808080; font-style: italic;">// starting the fire effect</span>
            <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> startFire<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
            <span style="color: #66cc66;">&#123;</span>
                <span style="color: #808080; font-style: italic;">// showing the object holder</span>
                myUIComponent.<span style="color: #0066CC;">visible</span> = <span style="color: #000000; font-weight: bold;">true</span>;
                <span style="color: #808080; font-style: italic;">// starting the effect</span>
                _layer.<span style="color: #006600;">startRender</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
                <span style="color: #808080; font-style: italic;">// events and label set for button</span>
                myButton.<span style="color: #006600;">removeEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">CLICK</span>, startFire<span style="color: #66cc66;">&#41;</span>;
                myButton.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">CLICK</span>, endFire<span style="color: #66cc66;">&#41;</span>;
                myButton.<span style="color: #006600;">label</span> = _endFireText;
            <span style="color: #66cc66;">&#125;</span>
&nbsp;
            <span style="color: #808080; font-style: italic;">// ending the fire effect</span>
            <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> endFire<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
            <span style="color: #66cc66;">&#123;</span>
                <span style="color: #808080; font-style: italic;">// hiddinh the object holder</span>
                myUIComponent.<span style="color: #0066CC;">visible</span> = <span style="color: #000000; font-weight: bold;">false</span>;
                <span style="color: #808080; font-style: italic;">// stoping the effect</span>
                _layer.<span style="color: #006600;">stopRender</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
                <span style="color: #808080; font-style: italic;">// events and label for button</span>
                myButton.<span style="color: #006600;">removeEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">CLICK</span>, endFire<span style="color: #66cc66;">&#41;</span>;
                myButton.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">CLICK</span>, startFire<span style="color: #66cc66;">&#41;</span>;
                myButton.<span style="color: #006600;">label</span> = _startFireText;
            <span style="color: #66cc66;">&#125;</span>
        <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;/</span>mx:Script<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;/</span>mx:Application<span style="color: #66cc66;">&gt;</span></pre></td></tr></table></div>

<p>I hope the code is clear and well documented. The values used are taken from the examples found in the Tweensy archive and some of them modified by trial and error to suit my needs. The documentation is ok but it can be better because some details are missing. There is a need to specify that the particle model is a png image &#8211; a flame image (see source file archive).</p>
<p>Anyway, Shane did a great job with this effects library because is more than a tween library.</p>
<p>If you&#8217;re wondering which of the three available Tweensy version I used&#8230; the answer is <strong>Tweensy FX</strong>. Only Tweensy FX contains the particles generation module.</p>
<p><span style="color:red"><strong>Attention:</strong> Do not right click on the application. It seems that there is a problem with this because the browser window freezes a while.</span></p>
<p>As usual source files are available for download.</p>
<p>Resources on Tweensy:<br />
<a href="http://www.lostinactionscript.com/blog/index.php/2008/08/31/as3-tween-engine-tweensy-preview/" target="_blank">Preview article on Lost in Actionscript blog</a><br />
<a href="http://code.google.com/p/tweensy/" target="_blank">Tweensy on Google Code</a><br />
<a href="http://code.google.com/p/tweensy/downloads/list" target="_blank">Download page for Tweensy on Google Code</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexer.info/2009/05/01/tweensy-tweening-effects-library-includes-particles-generator-engine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Use FIVe3D And Tweening in Flex</title>
		<link>http://www.flexer.info/2008/06/19/how-to-use-five3d-and-tweening-in-flex/</link>
		<comments>http://www.flexer.info/2008/06/19/how-to-use-five3d-and-tweening-in-flex/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 10:50:46 +0000</pubDate>
		<dc:creator>Andrei Ionescu</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Tweening]]></category>
		<category><![CDATA[five3d]]></category>

		<guid isPermaLink="false">http://www.flexer.info/?p=209</guid>
		<description><![CDATA[In a previous article I explained how to use FIVe3D with Flex and because fl.motion is not included into the Flex Framework we had to find out a workaround. I commented out the lines that referenced fl.motion but Kelvin Luck found another way: &#8220;copy the classes from Flash CS3 Actionscript framework into the project&#8221;. So [...]]]></description>
			<content:encoded><![CDATA[<div class='series_toc'><h3>Table of contents<!-- for FIVe3D, Tweening and Flex --></h3><ol><li><a href='http://www.flexer.info/2008/06/17/how-to-use-five3d-in-flex/' title='How To Use FIVe3D In Flex'>How To Use FIVe3D In Flex</a></li><li>How To Use FIVe3D And Tweening in Flex</li></ol></div> <div class="tweetmeme_button" style="float: right; margin-right: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.flexer.info%2F2008%2F06%2F19%2Fhow-to-use-five3d-and-tweening-in-flex%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.flexer.info%2F2008%2F06%2F19%2Fhow-to-use-five3d-and-tweening-in-flex%2F" height="61" width="51" /></a></div><div style="float: right; margin-right: 10px"><a class="google_buzz"  
href="http://www.google.com/reader/link?url=http://www.flexer.info/2008/06/19/how-to-use-five3d-and-tweening-in-flex/&title=How+To+Use+FIVe3D+And+Tweening+in+Flex&srcURL=http://www.flexer.info" target="_blank" rel="nofollow"><img
src="http://www.flexer.info/wp-content/plugins/google-buzz-button-for-wordpress/images/google-buzz.png" alt="Google Buzz" /></a></div><p>In a <a href="http://www.flexer.info/2008/06/17/how-to-use-five3d-in-flex">previous article</a> I explained how to use FIVe3D with Flex and because <strong>fl.motion</strong> is not included into the Flex Framework we had to find out a workaround. I commented out the lines that referenced fl.motion but <a href="http://www.flexer.info/2008/06/17/how-to-use-five3d-in-flex/#comment-301">Kelvin Luck</a> found another way: &#8220;copy the classes from Flash CS3 Actionscript framework into the project&#8221;. So this time the FIVe3D framework is untouched and fl.motion is included into the project.</p>
<p>Lets skip the intro and get into it&#8230; In this article I added some tweening to the example from the previous article. The framework I used are:</p>
<ul class="ul">
<li><strong>TweenLite</strong> &#8211; <a href="http://blog.greensock.com/tweenliteas3/" target="_blank">http://blog.greensock.com/tweenliteas3/</a></li>
<li><strong>fl.transition</strong> &#8211; taken from Flash CS3 Actionscript 3 Framework</li>
<li><strong>Tweener</strong> &#8211; <a href="http://code.google.com/p/tweener/" target="_blank">http://code.google.com/p/tweener/</a></li>
</ul>
<p>These are the tree tweening frameworks we will add but from all of them <strong>TweenLite</strong> seems to be the easiest to use.<br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_five3d_tween_2096170900"
			class="flashmovie"
			width="500"
			height="600">
	<param name="movie" value="/wp-content/uploads/2008/06/five3d_tween.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/wp-content/uploads/2008/06/five3d_tween.swf"
			name="fm_five3d_tween_2096170900"
			width="500"
			height="600">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object><br />
There is no visible difference between <strong>TweenLite</strong>, <strong>fl.transition</strong> and <strong>Tweener</strong> but in the future I may add some benchmarks.</p>
<p>Now take a look at the code and you can choose what tweenning library you&#8217;ll use.</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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&lt;</span>?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;</span>mx:Application xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> 
    backgroundGradientColors=<span style="color: #ff0000;">&quot;[#dddddd,#dddddd]&quot;</span>
    layout=<span style="color: #ff0000;">&quot;absolute&quot;</span> 
    <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;500&quot;</span>
    <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;600&quot;</span>
    creationComplete=<span style="color: #ff0000;">&quot;start()&quot;</span><span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>mx:UIComponent id=<span style="color: #ff0000;">&quot;mainUI&quot;</span> 
        <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;500&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;500&quot;</span><span style="color: #66cc66;">/&gt;</span>
    <span style="color: #66cc66;">&lt;</span>mx:Script<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;!</span><span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span>
&nbsp;
            <span style="color: #0066CC;">import</span> five3D.<span style="color: #006600;">typography</span>.<span style="color: #006600;">HelveticaBold</span>;
            <span style="color: #0066CC;">import</span> five3D.<span style="color: #006600;">utils</span>.<span style="color: #006600;">Drawing</span>;
            <span style="color: #0066CC;">import</span> five3D.<span style="color: #006600;">display</span>.<span style="color: #006600;">Scene3D</span>;
            <span style="color: #0066CC;">import</span> five3D.<span style="color: #006600;">display</span>.<span style="color: #006600;">DynamicText3D</span>;
            <span style="color: #0066CC;">import</span> five3D.<span style="color: #006600;">display</span>.<span style="color: #006600;">Shape3D</span>;
            <span style="color: #0066CC;">import</span> five3D.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite3D</span>;
&nbsp;
            <span style="color: #0066CC;">import</span> gs.<span style="color: #006600;">TweenLite</span>;
            <span style="color: #0066CC;">import</span> caurina.<span style="color: #006600;">transitions</span>.<span style="color: #006600;">Tweener</span>;
            <span style="color: #0066CC;">import</span> fl.<span style="color: #006600;">transitions</span>.<span style="color: #006600;">Tween</span>;
            <span style="color: #808080; font-style: italic;">// we will use Exponential.easeOut </span>
            <span style="color: #808080; font-style: italic;">// function in tweening</span>
            <span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">effects</span>.<span style="color: #006600;">easing</span>.<span style="color: #006600;">Exponential</span>;
&nbsp;
            <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> scene3D:Scene3D;
            <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> sprite3D:Sprite3D;
            <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> star3d:Shape3D;
            <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> flexerWord:DynamicText3D;
            <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> hiWord:DynamicText3D;
&nbsp;
            <span style="color: #808080; font-style: italic;">// start drawing</span>
            <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
            <span style="color: #66cc66;">&#123;</span>
                <span style="color: #808080; font-style: italic;">// create the scene</span>
                scene3D = <span style="color: #000000; font-weight: bold;">new</span> Scene3D<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
                scene3D.<span style="color: #006600;">x</span> = <span style="color: #cc66cc;">250</span>;
                scene3D.<span style="color: #006600;">y</span> = <span style="color: #cc66cc;">250</span>;
                <span style="color: #808080; font-style: italic;">// create the round rectangle/square</span>
                sprite3D = <span style="color: #000000; font-weight: bold;">new</span> Sprite3D<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
                sprite3D.<span style="color: #006600;">graphics3D</span>.<span style="color: #0066CC;">beginFill</span><span style="color: #66cc66;">&#40;</span>0x000000<span style="color: #66cc66;">&#41;</span>;
                sprite3D.<span style="color: #006600;">graphics3D</span>.<span style="color: #006600;">drawRoundRect</span><span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">150</span>,-<span style="color: #cc66cc;">150</span>,<span style="color: #cc66cc;">300</span>,<span style="color: #cc66cc;">300</span>,<span style="color: #cc66cc;">40</span>,<span style="color: #cc66cc;">40</span><span style="color: #66cc66;">&#41;</span>;
                sprite3D.<span style="color: #006600;">graphics3D</span>.<span style="color: #0066CC;">endFill</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
                <span style="color: #808080; font-style: italic;">// rotate the round rectangle/square randomly</span>
                sprite3D.<span style="color: #006600;">rotationX</span> = <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">100</span>-<span style="color: #cc66cc;">50</span>;
                sprite3D.<span style="color: #006600;">rotationY</span> = <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">100</span>-<span style="color: #cc66cc;">50</span>;
                sprite3D.<span style="color: #006600;">rotationZ</span> = <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">100</span>-<span style="color: #cc66cc;">50</span>;
                <span style="color: #808080; font-style: italic;">// create the star</span>
                star3d = <span style="color: #000000; font-weight: bold;">new</span> Shape3D<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
                Drawing.<span style="color: #006600;">star</span><span style="color: #66cc66;">&#40;</span>star3d.<span style="color: #006600;">graphics3D</span>,<span style="color: #cc66cc;">20</span>,<span style="color: #cc66cc;">60</span>,<span style="color: #cc66cc;">50</span>,<span style="color: #cc66cc;">0</span>,0x6699cc<span style="color: #66cc66;">&#41;</span>;
                star3d.<span style="color: #006600;">x</span> = <span style="color: #cc66cc;">120</span>;
                star3d.<span style="color: #006600;">y</span> = -<span style="color: #cc66cc;">80</span>;
                <span style="color: #808080; font-style: italic;">// rotate the start</span>
                star3d.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>,
                    <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
                        <span style="color: #808080; font-style: italic;">// rotate on Z axe </span>
                        event.<span style="color: #0066CC;">target</span>.<span style="color: #006600;">rotationZ</span>++; 
                    <span style="color: #66cc66;">&#125;</span>
                <span style="color: #66cc66;">&#41;</span>;
                <span style="color: #808080; font-style: italic;">// &quot;fxr&quot; word</span>
                flexerWord = <span style="color: #000000; font-weight: bold;">new</span> DynamicText3D<span style="color: #66cc66;">&#40;</span>HelveticaBold<span style="color: #66cc66;">&#41;</span>;
                flexerWord.<span style="color: #0066CC;">size</span> = <span style="color: #cc66cc;">45</span>;
                flexerWord.<span style="color: #0066CC;">color</span> = 0xFFFFFF;
                flexerWord.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">&quot;Fxr&quot;</span>;
                flexerWord.<span style="color: #006600;">x</span> = <span style="color: #cc66cc;">88</span>;
                flexerWord.<span style="color: #006600;">y</span> = -<span style="color: #cc66cc;">110</span>;
                <span style="color: #808080; font-style: italic;">// &quot;hi&quot; word</span>
                hiWord = <span style="color: #000000; font-weight: bold;">new</span> DynamicText3D<span style="color: #66cc66;">&#40;</span>HelveticaBold<span style="color: #66cc66;">&#41;</span>;
                hiWord.<span style="color: #0066CC;">size</span> = <span style="color: #cc66cc;">100</span>;
                hiWord.<span style="color: #0066CC;">color</span> = 0x555555;
                hiWord.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">&quot;Hi!&quot;</span>;
                hiWord.<span style="color: #006600;">x</span> = -<span style="color: #cc66cc;">112</span>;
                hiWord.<span style="color: #006600;">y</span> = -<span style="color: #cc66cc;">34</span>;
                <span style="color: #808080; font-style: italic;">// click event on the round rectangle/square</span>
                sprite3D.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">CLICK</span>,handleSquareClick<span style="color: #66cc66;">&#41;</span>;
                sprite3D.<span style="color: #006600;">mouseChildren</span> = <span style="color: #000000; font-weight: bold;">false</span>;
                sprite3D.<span style="color: #006600;">buttonMode</span> = <span style="color: #000000; font-weight: bold;">true</span>;
                <span style="color: #808080; font-style: italic;">// adding scene to the main UI component</span>
                mainUI.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>scene3D<span style="color: #66cc66;">&#41;</span>;
                <span style="color: #808080; font-style: italic;">// adding round rectangle/square to the scene</span>
                scene3D.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>sprite3D<span style="color: #66cc66;">&#41;</span>;
                <span style="color: #808080; font-style: italic;">// adding the start to the round rectangle/square</span>
                sprite3D.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>star3d<span style="color: #66cc66;">&#41;</span>;
                <span style="color: #808080; font-style: italic;">// adding &quot;fxr&quot; word to the round rectangle/square</span>
                sprite3D.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>flexerWord<span style="color: #66cc66;">&#41;</span>;
                <span style="color: #808080; font-style: italic;">// adding &quot;hi&quot; word to the round rectangle/square</span>
                sprite3D.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>hiWord<span style="color: #66cc66;">&#41;</span>;
            <span style="color: #66cc66;">&#125;</span>
&nbsp;
            <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> handleSquareClick<span style="color: #66cc66;">&#40;</span>event:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
            <span style="color: #66cc66;">&#123;</span>
                <span style="color: #808080; font-style: italic;">// rotate the round rectangle/square randomly</span>
                <span style="color: #808080; font-style: italic;">// all 3 axes</span>
                <span style="color: #b1b100;">switch</span> <span style="color: #66cc66;">&#40;</span>whichTween.<span style="color: #006600;">selectedValue</span><span style="color: #66cc66;">&#41;</span>
                <span style="color: #66cc66;">&#123;</span>
                    <span style="color: #b1b100;">case</span> <span style="color: #ff0000;">&quot;notween&quot;</span>:
                    <span style="color: #66cc66;">&#123;</span>
                        <span style="color: #808080; font-style: italic;">// no tween</span>
                        event.<span style="color: #0066CC;">target</span>.<span style="color: #006600;">rotationX</span> = <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">100</span>-<span style="color: #cc66cc;">50</span>;
                        event.<span style="color: #0066CC;">target</span>.<span style="color: #006600;">rotationY</span> = <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">100</span>-<span style="color: #cc66cc;">50</span>;
                        event.<span style="color: #0066CC;">target</span>.<span style="color: #006600;">rotationZ</span> = <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">100</span>-<span style="color: #cc66cc;">50</span>;
                        <span style="color: #b1b100;">break</span>;
                    <span style="color: #66cc66;">&#125;</span>
                    <span style="color: #b1b100;">case</span> <span style="color: #ff0000;">&quot;tweenlite&quot;</span>:
                    <span style="color: #66cc66;">&#123;</span>
                        <span style="color: #808080; font-style: italic;">// using TweenLite</span>
                        TweenLite.<span style="color: #006600;">to</span><span style="color: #66cc66;">&#40;</span>
                            <span style="color: #808080; font-style: italic;">// target object</span>
                            event.<span style="color: #0066CC;">target</span>,
                            <span style="color: #808080; font-style: italic;">// duration</span>
                            <span style="color: #cc66cc;">1.5</span>,
                            <span style="color: #66cc66;">&#123;</span>
                                <span style="color: #808080; font-style: italic;">// target property: value</span>
                                rotationX:<span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">100</span>-<span style="color: #cc66cc;">50</span>,
                                <span style="color: #808080; font-style: italic;">// target property: value</span>
                                rotationY:<span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">100</span>-<span style="color: #cc66cc;">50</span>,
                                <span style="color: #808080; font-style: italic;">// target property: value</span>
                                rotationZ:<span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">100</span>-<span style="color: #cc66cc;">50</span>,
                                <span style="color: #808080; font-style: italic;">// easing function</span>
                                ease:Exponential.<span style="color: #006600;">easeOut</span>
                            <span style="color: #66cc66;">&#125;</span>
                        <span style="color: #66cc66;">&#41;</span>;
                        <span style="color: #b1b100;">break</span>;
                    <span style="color: #66cc66;">&#125;</span>
                    <span style="color: #b1b100;">case</span> <span style="color: #ff0000;">&quot;tweener&quot;</span>:
                    <span style="color: #66cc66;">&#123;</span>
                        <span style="color: #808080; font-style: italic;">// using Tweener</span>
                        Tweener.<span style="color: #006600;">addTween</span><span style="color: #66cc66;">&#40;</span>
                            <span style="color: #808080; font-style: italic;">// target object</span>
                            event.<span style="color: #0066CC;">target</span>,
                            <span style="color: #66cc66;">&#123;</span>
                                <span style="color: #808080; font-style: italic;">// target property: value</span>
                                rotationX:<span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">100</span>-<span style="color: #cc66cc;">50</span>,
                                <span style="color: #808080; font-style: italic;">// target property: value</span>
                                rotationY:<span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">100</span>-<span style="color: #cc66cc;">50</span>,
                                <span style="color: #808080; font-style: italic;">// target property: value</span>
                                rotationZ:<span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">100</span>-<span style="color: #cc66cc;">50</span>,
                                <span style="color: #808080; font-style: italic;">// duration</span>
                                <span style="color: #0066CC;">time</span>:<span style="color: #cc66cc;">1.5</span>,
                                <span style="color: #808080; font-style: italic;">// easing function</span>
                                transition:<span style="color: #ff0000;">&quot;easeoutexponential&quot;</span>
                            <span style="color: #66cc66;">&#125;</span>
                        <span style="color: #66cc66;">&#41;</span>;
                        <span style="color: #b1b100;">break</span>;
                    <span style="color: #66cc66;">&#125;</span>
                    <span style="color: #b1b100;">case</span> <span style="color: #ff0000;">&quot;fltransition&quot;</span>:
                    <span style="color: #66cc66;">&#123;</span>
                        <span style="color: #808080; font-style: italic;">// using fl.transition from Flash </span>
                        <span style="color: #808080; font-style: italic;">// CS3 Actionscript 3 Framework</span>
                        <span style="color: #000000; font-weight: bold;">var</span> xTween:Tween = <span style="color: #000000; font-weight: bold;">new</span> Tween<span style="color: #66cc66;">&#40;</span>
                            event.<span style="color: #0066CC;">target</span> <span style="color: #808080; font-style: italic;">/* target object */</span>,
                            <span style="color: #ff0000;">&quot;rotationX&quot;</span> <span style="color: #808080; font-style: italic;">/* target property */</span>,
                            Exponential.<span style="color: #006600;">easeOut</span> <span style="color: #808080; font-style: italic;">/* easing function */</span>,
                            event.<span style="color: #0066CC;">target</span>.<span style="color: #006600;">rotationX</span> <span style="color: #808080; font-style: italic;">/* start point */</span>,
                            <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">100</span>-<span style="color: #cc66cc;">50</span> <span style="color: #808080; font-style: italic;">/* end point */</span>,
                            <span style="color: #cc66cc;">1.5</span> <span style="color: #808080; font-style: italic;">/*duration in seconds */</span>,
                            <span style="color: #000000; font-weight: bold;">true</span> <span style="color: #808080; font-style: italic;">/* use seconds */</span>
                        <span style="color: #66cc66;">&#41;</span>;
                        xTween.<span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
                        <span style="color: #000000; font-weight: bold;">var</span> yTween:Tween = <span style="color: #000000; font-weight: bold;">new</span> Tween<span style="color: #66cc66;">&#40;</span>
                            event.<span style="color: #0066CC;">target</span> <span style="color: #808080; font-style: italic;">/* target object */</span>,
                            <span style="color: #ff0000;">&quot;rotationY&quot;</span> <span style="color: #808080; font-style: italic;">/* target property */</span>,
                            Exponential.<span style="color: #006600;">easeOut</span> <span style="color: #808080; font-style: italic;">/* easing function */</span>,
                            event.<span style="color: #0066CC;">target</span>.<span style="color: #006600;">rotationY</span> <span style="color: #808080; font-style: italic;">/* start point */</span>,
                            <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">100</span>-<span style="color: #cc66cc;">50</span> <span style="color: #808080; font-style: italic;">/* end point */</span>,
                            <span style="color: #cc66cc;">1.5</span> <span style="color: #808080; font-style: italic;">/*duration in seconds */</span>,
                            <span style="color: #000000; font-weight: bold;">true</span> <span style="color: #808080; font-style: italic;">/* use seconds */</span>
                        <span style="color: #66cc66;">&#41;</span>;
                        yTween.<span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
                        <span style="color: #000000; font-weight: bold;">var</span> zTween:Tween = <span style="color: #000000; font-weight: bold;">new</span> Tween<span style="color: #66cc66;">&#40;</span>
                            event.<span style="color: #0066CC;">target</span> <span style="color: #808080; font-style: italic;">/* target object */</span>,
                            <span style="color: #ff0000;">&quot;rotationZ&quot;</span> <span style="color: #808080; font-style: italic;">/* target property */</span>,
                            Exponential.<span style="color: #006600;">easeOut</span> <span style="color: #808080; font-style: italic;">/* easing function */</span>,
                            event.<span style="color: #0066CC;">target</span>.<span style="color: #006600;">rotationZ</span> <span style="color: #808080; font-style: italic;">/* start point */</span>,
                            <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">100</span>-<span style="color: #cc66cc;">50</span> <span style="color: #808080; font-style: italic;">/* end point */</span>,
                            <span style="color: #cc66cc;">1.5</span> <span style="color: #808080; font-style: italic;">/*duration in seconds */</span>,
                            <span style="color: #000000; font-weight: bold;">true</span> <span style="color: #808080; font-style: italic;">/* use seconds */</span>
                        <span style="color: #66cc66;">&#41;</span>;
                        zTween.<span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
                        <span style="color: #b1b100;">break</span>;
                    <span style="color: #66cc66;">&#125;</span>
                <span style="color: #66cc66;">&#125;</span>
            <span style="color: #66cc66;">&#125;</span>
&nbsp;
        <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;/</span>mx:Script<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>mx:RadioButtonGroup id=<span style="color: #ff0000;">&quot;whichTween&quot;</span><span style="color: #66cc66;">/&gt;</span>
    <span style="color: #66cc66;">&lt;</span>mx:RadioButton x=<span style="color: #ff0000;">&quot;10.0&quot;</span> y=<span style="color: #ff0000;">&quot;572&quot;</span> label=<span style="color: #ff0000;">&quot;No Tween&quot;</span> groupName=<span style="color: #ff0000;">&quot;whichTween&quot;</span> 
        value=<span style="color: #ff0000;">&quot;notween&quot;</span> selected=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #66cc66;">/&gt;</span>
    <span style="color: #66cc66;">&lt;</span>mx:RadioButton x=<span style="color: #ff0000;">&quot;105&quot;</span> y=<span style="color: #ff0000;">&quot;572&quot;</span> label=<span style="color: #ff0000;">&quot;TweenLite&quot;</span> groupName=<span style="color: #ff0000;">&quot;whichTween&quot;</span> 
        value=<span style="color: #ff0000;">&quot;tweenlite&quot;</span><span style="color: #66cc66;">/&gt;</span>
    <span style="color: #66cc66;">&lt;</span>mx:RadioButton x=<span style="color: #ff0000;">&quot;202&quot;</span> y=<span style="color: #ff0000;">&quot;572&quot;</span> label=<span style="color: #ff0000;">&quot;fl.transition&quot;</span> groupName=<span style="color: #ff0000;">&quot;whichTween&quot;</span> 
        value=<span style="color: #ff0000;">&quot;fltransition&quot;</span><span style="color: #66cc66;">/&gt;</span>
    <span style="color: #66cc66;">&lt;</span>mx:RadioButton x=<span style="color: #ff0000;">&quot;307&quot;</span> y=<span style="color: #ff0000;">&quot;572&quot;</span> label=<span style="color: #ff0000;">&quot;Tweener&quot;</span> groupName=<span style="color: #ff0000;">&quot;whichTween&quot;</span> 
        value=<span style="color: #ff0000;">&quot;tweener&quot;</span><span style="color: #66cc66;">/&gt;</span>
<span style="color: #66cc66;">&lt;/</span>mx:Application<span style="color: #66cc66;">&gt;</span></pre></td></tr></table></div>

<p>This is all for now&#8230; the source files are available to download.</p>
<p>Some additional resources regarding tweening: <a href="http://blog.greensock.com/tweenliteas3/" target="blank">TweenLite</a>, <a href="http://code.google.com/p/tweener/" target="blank">Tweener</a>, <a href="http://www.zedia.net/2008/actionscript-3-tweenlite-basic-tutorial/" target="blank">TweenLite Basic Tutorial</a>, <a href="http://www.zedia.net/actionscript-3-tweens-tutorial/" target="_blank">Tweens tutorial</a> and <a hred="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/fl/transitions/Tween.html#includeExamplesSummary" target="_blank">fl.transition at LiveDocs</a></p>
 <div class='series_links'><a href='http://www.flexer.info/2008/06/17/how-to-use-five3d-in-flex/' title='How To Use FIVe3D In Flex'>Previous in series</a> </div>]]></content:encoded>
			<wfw:commentRss>http://www.flexer.info/2008/06/19/how-to-use-five3d-and-tweening-in-flex/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

