<?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>X-Com</title>
	<atom:link href="http://www.x-com.se/feed" rel="self" type="application/rss+xml" />
	<link>http://www.x-com.se</link>
	<description>X-Com är ett webbproduktionsbolag som producerar kampanjer, spel, tävlingar, webbplatser och applikationer.</description>
	<lastBuildDate>Thu, 26 Aug 2010 11:33:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SmokeFX &#8211; An experiment with Bezier Curves</title>
		<link>http://www.x-com.se/labs/flash/smokefx-an-experiment-with-bezier-curves.html</link>
		<comments>http://www.x-com.se/labs/flash/smokefx-an-experiment-with-bezier-curves.html#comments</comments>
		<pubDate>Thu, 26 Aug 2010 11:33:30 +0000</pubDate>
		<dc:creator>Andreas</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[bezier]]></category>
		<category><![CDATA[beziercurves]]></category>
		<category><![CDATA[colourcurves]]></category>
		<category><![CDATA[curve]]></category>
		<category><![CDATA[effect]]></category>
		<category><![CDATA[effects]]></category>
		<category><![CDATA[smoke]]></category>

		<guid isPermaLink="false">http://www.x-com.se/?p=1222</guid>
		<description><![CDATA[Since the dawn of the computer people has always created ...]]></description>
			<content:encoded><![CDATA[<p>Since the dawn of the computer people has always created colourful art using curves. Either they have moved around on the screen or just being drawn with small adjustments creating mesmerizing patterns.<br />
Being inspired by the latest PS3 boot menu I decided to create a nice looking (and dynamic) effect using Bezier curves. Here&#8217;s the treat:<br />
<a rel="shadowbox;width=900;height=450" href="/wp-content/uploads/2010/08/colourCurves.swf"><img title="ColourCurves" src="/wp-content/uploads/2010/08/colourCurves_preview.png" alt="ColourCurves" width="600" height="340" /></a></p>
<p><span id="more-1222"></span><br />
Now, from start, there is a problem here. AS3 doesn&#8217;t support more than one control point (via the curveTo() method). To be a able to draw nice continuous curves we need 2 control points (Cubic Bezier).</p>
<p>Luckily I don&#8217;t have to worry about that as I could find <a href="http://www.cartogrammar.com/blog/actionscript-curves-update/">this great class</a> taking care of all that math I lost out as a very happy but maybe not so focused student. Wonderful! Most of the work done already, let&#8217;s put it to use!</p>
<p>I decided to divide the whole effect into 3 classes.</p>
<p><strong>WaveData</strong> &#8211; Holding all the data about the wave including controlpoint-position. The Class is also controlling the logical animation of the controlpoints + the colour of the wave, using our beloved tweenengine <a href="http://www.greensock.com/tweenmax/">TweenMax</a>.</p>
<p><strong>Wave</strong> &#8211; Being the DisplayObject that is the actual visual representation of the WaveData (being a SINGLE wave that is)</p>
<p><strong>Canvas</strong> &#8211; This is the area that will be visual on the screen. All Waves are draw to the canvas and a few pretty effects are added to the canvas. We&#8217;ll get to that.</p>
<p>Now let&#8217;s get started with the WaveData:</p>
<div class="codesnip-container-wrapper">
<div class="codesnip-container-innerwrapper">
<div class="codesnip-container" >
<div class="actionscript codesnip" style="font-family:monospace;">package<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> com.<span class="me1">greensock</span>.<span class="me1">TweenMax</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> com.<span class="me1">greensock</span>.<span class="me1">easing</span>.<span class="me1">Sine</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">geom</span>.<span class="me1">Point</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">class</span> WaveData<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">var</span> controlPoints:<span class="kw3">int</span> = 7<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">var</span> minRadius:<span class="kw3">Number</span> = <span class="nu0">0.1</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">var</span> maxRadius:<span class="kw3">Number</span>= <span class="nu0">1</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">var</span> waveAlpha:<span class="kw3">Number</span> = 0.08<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">var</span> lineWidth:<span class="kw3">Number</span> = <span class="nu0">0</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">var</span> minSpeed:<span class="kw3">Number</span> = <span class="nu0">5</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">var</span> maxSpeed:<span class="kw3">Number</span> = <span class="nu0">8</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">var</span> <span class="kw3">color</span>:<span class="kw3">int</span> = <span class="nu0">0</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">var</span> aPoints:<span class="kw3">Array</span>&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// no constructor needed. Best practise?? Naah, maybe not but hey, I get to write a comment instead of a constructor.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// resets the wavedata and starts the animation of the controlpoints and the wavecolour.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> reset<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> y:<span class="kw3">Number</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> p:Point;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aPoints = <span class="br0">&#91;</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// create all controlpoints and place them within the radius. They all starts at x:0</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw2">var</span> i:<span class="kw3">int</span> = <span class="nu0">0</span>;i<span class="sy0">&lt;</span>controlPoints;i++<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span> &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; y = 2<span class="sy0">*</span><span class="br0">&#40;</span><span class="kw3">Math</span>.<span class="kw3">random</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">*</span><span class="br0">&#40;</span>maxRadius-minRadius<span class="br0">&#41;</span>+minRadius<span class="br0">&#41;</span>-maxRadius;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; p = <span class="kw2">new</span> Point<span class="br0">&#40;</span>0,y<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aPoints.<span class="kw3">push</span><span class="br0">&#40;</span>p<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; startAnim<span class="br0">&#40;</span>p<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; animColour<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">function</span> animColour<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> newColor = <span class="kw3">Math</span>.<span class="kw3">random</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">*</span>0xffffff;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TweenMax.<span class="me1">to</span><span class="br0">&#40;</span><span class="kw3">this</span>, 9, <span class="br0">&#123;</span>hexColors:<span class="br0">&#123;</span><span class="kw3">color</span>:newColor<span class="br0">&#125;</span>,onComplete:animColour<span class="br0">&#125;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">function</span> startAnim<span class="br0">&#40;</span>p:Point<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// no, it&#8217;s not an optimized way to find the point but it&#8217;s a lab, remember? ;)</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> ip:<span class="kw3">int</span> = aPoints.<span class="kw3">indexOf</span><span class="br0">&#40;</span>p<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> newY:<span class="kw3">Number</span> = <span class="kw3">Math</span>.<span class="kw3">random</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">*</span><span class="br0">&#40;</span>maxRadius-minRadius<span class="br0">&#41;</span>+minRadius<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// x is being set &quot;somewhat&quot; around the section where it should be.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> newX:<span class="kw3">Number</span> = &nbsp;<span class="br0">&#40;</span>ip==0<span class="br0">&#41;</span>?0:<span class="br0">&#40;</span><span class="br0">&#40;</span>ip<span class="sy0">/</span><span class="br0">&#40;</span>controlPoints-1<span class="br0">&#41;</span>+<span class="br0">&#40;</span><span class="kw3">Math</span>.<span class="kw3">random</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">*</span><span class="br0">&#40;</span>1<span class="sy0">/</span><span class="br0">&#40;</span>controlPoints-1<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">*</span>4<span class="br0">&#41;</span><span class="br0">&#41;</span>-<span class="br0">&#40;</span>2<span class="sy0">*</span><span class="br0">&#40;</span>1<span class="sy0">/</span><span class="br0">&#40;</span>controlPoints-1<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// is the direction of the controlpoint going UP or DOWN?</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>p.<span class="me1">y</span> <span class="sy0">&gt;</span> 0<span class="br0">&#41;</span> newY=-newY;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//animate!</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TweenMax.<span class="me1">to</span><span class="br0">&#40;</span>p,<span class="br0">&#40;</span><span class="kw3">Math</span>.<span class="kw3">random</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">*</span><span class="br0">&#40;</span>maxSpeed-minSpeed<span class="br0">&#41;</span><span class="br0">&#41;</span>+minSpeed,<span class="br0">&#123;</span>ease:Sine.<span class="me1">easeInOut</span>,y:newY,x:newX,onComplete:startAnim,onCompleteParams:<span class="br0">&#91;</span>p<span class="br0">&#93;</span><span class="br0">&#125;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
</div>
</div>
</div>
<p>Pay attention to the fact that the controlpoints are just moving between  1 to -1 . This means that they are not having their physical width in here but will be multiplied later on in the Wave-class So let&#8217;s get going. Next class please!</p>
<div class="codesnip-container-wrapper">
<div class="codesnip-container-innerwrapper">
<div class="codesnip-container" >
<div class="actionscript codesnip" style="font-family:monospace;">package<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">display</span>.<span class="me1">Sprite</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">events</span>.<span class="me1">Event</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">geom</span>.<span class="me1">Point</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">class</span> Wave <span class="kw3">extends</span> Sprite<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">var</span> waveWidth:<span class="kw3">Number</span> = <span class="nu0">650</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">var</span> waveHeight:<span class="kw3">Number</span> = <span class="nu0">150</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">var</span> <span class="kw3">data</span>:WaveData<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> Wave<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">super</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// creates data and starts the animation</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">data</span> = <span class="kw2">new</span> WaveData<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">data</span>.<span class="me1">reset</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> update<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// creating real coordinates from Wave-data controlpoints</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> counter:<span class="kw3">int</span> = <span class="nu0">0</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> coord:<span class="kw3">Array</span> = <span class="br0">&#91;</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="kw1">each</span><span class="br0">&#40;</span><span class="kw2">var</span> p:Point <span class="kw1">in</span> <span class="kw3">data</span>.<span class="me1">aPoints</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; coord.<span class="kw3">push</span> <span class="br0">&#40;</span><span class="kw2">new</span> Point<span class="br0">&#40;</span>p.<span class="me1">x</span><span class="sy0">*</span>waveWidth,p.<span class="me1">y</span><span class="sy0">*</span>waveHeight<span class="br0">&#41;</span><span class="br0">&#41;</span>;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// draw curve</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; graphics.<span class="kw3">clear</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; graphics.<span class="kw3">lineStyle</span><span class="br0">&#40;</span><span class="kw3">data</span>.<span class="me1">lineWidth</span>,<span class="kw3">data</span>.<span class="kw3">color</span>,<span class="kw3">data</span>.<span class="me1">waveAlpha</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CubicBezier.<span class="me1">curveThroughPoints</span><span class="br0">&#40;</span>graphics,coord<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
</div>
</div>
</div>
<p>Now the wave is clearly a fully animated wave. If you add this one to the stage you will see a thin line waving around.. but we want more, right? Next class please!</p>
<div class="codesnip-container-wrapper">
<div class="codesnip-container-innerwrapper">
<div class="codesnip-container" >
<div class="actionscript codesnip" style="font-family:monospace;">package<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">display</span>.<span class="me1">Bitmap</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">display</span>.<span class="me1">BitmapData</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">display</span>.<span class="me1">BlendMode</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">display</span>.<span class="me1">Sprite</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">events</span>.<span class="me1">Event</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">filters</span>.<span class="me1">BitmapFilter</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">filters</span>.<span class="me1">BlurFilter</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">geom</span>.<span class="me1">Matrix</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">geom</span>.<span class="me1">Point</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">geom</span>.<span class="me1">Rectangle</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">class</span> Canvas <span class="kw3">extends</span> Sprite<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> bmpd:BitmapData<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> aWaves:<span class="kw3">Array</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> w:<span class="kw3">int</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> h:<span class="kw3">int</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> Canvas<span class="br0">&#40;</span>w:<span class="kw3">int</span> = 900,h:<span class="kw3">int</span> = 450<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">super</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// set the width and height of the canvas</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">this</span>.<span class="me1">w</span> = w;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">this</span>.<span class="me1">h</span> = h;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aWaves=<span class="br0">&#91;</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// adding a bitmap to stage</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bmpd = <span class="kw2">new</span> BitmapData<span class="br0">&#40;</span>w,h,<span class="kw2">false</span>,0<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> bmp:Bitmap = <span class="kw2">new</span> Bitmap<span class="br0">&#40;</span>bmpd<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addChild<span class="br0">&#40;</span>bmp<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> addWave<span class="br0">&#40;</span>wave:Wave<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// adding a wave to the canvas</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aWaves.<span class="kw3">push</span><span class="br0">&#40;</span>wave<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> startDraw<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addEventListener<span class="br0">&#40;</span>Event.<span class="me1">ENTER_FRAME</span>,onTick<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">function</span> onTick<span class="br0">&#40;</span><span class="kw3">e</span>:Event<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// each wave is now drawn onto the canvas using the ADD Blendmode.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="kw1">each</span> <span class="br0">&#40;</span> <span class="kw2">var</span> wave:Wave <span class="kw1">in</span> aWaves<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; wave.<span class="me1">update</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> m:Matrix = <span class="kw2">new</span> Matrix<span class="br0">&#40;</span>1,0,0,1,26,bmpd.<span class="kw3">height</span><span class="sy0">*</span>.5<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bmpd.<span class="me1">draw</span><span class="br0">&#40;</span>wave,m,<span class="kw2">null</span>,BlendMode.<span class="kw3">ADD</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// the canvas is now blurred out giving a blurred AND transitionout effect.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> filter:BlurFilter = <span class="kw2">new</span> BlurFilter<span class="br0">&#40;</span>3,3<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bmpd.<span class="me1">applyFilter</span><span class="br0">&#40;</span>bmpd, <span class="kw2">new</span> Rectangle<span class="br0">&#40;</span>0,0,w,h<span class="br0">&#41;</span>,<span class="kw2">new</span> Point<span class="br0">&#40;</span>0,0<span class="br0">&#41;</span>, filter<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// the bitmapdata is now scrolled to the right giving a &quot;moving feeling&quot; to the effect.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bmpd.<span class="kw3">scroll</span><span class="br0">&#40;</span><span class="nu0">5</span>,<span class="nu0">0</span><span class="br0">&#41;</span>&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
</div>
</div>
</div>
<p>Wow, amazing what a few postfilters can do. Just a blur and a pixelpush to the right does the trick. Now let&#8217;s put this all together in a Main class and try it out:</p>
<div class="codesnip-container-wrapper">
<div class="codesnip-container-innerwrapper">
<div class="codesnip-container" >
<div class="actionscript codesnip" style="font-family:monospace;">package<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">display</span>.<span class="me1">Sprite</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">class</span> Main <span class="kw3">extends</span> Sprite<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> Main<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> c:Canvas = <span class="kw2">new</span> Canvas<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// adding a few waves</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw2">var</span> i:<span class="kw3">int</span> = <span class="nu0">0</span>;i <span class="sy0">&lt;</span> <span class="nu0">3</span>;i++<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> w:Wave = <span class="kw2">new</span> Wave<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; c.<span class="me1">addWave</span><span class="br0">&#40;</span>w<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addChild<span class="br0">&#40;</span>c<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; c.<span class="me1">startDraw</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/labs/flash/smokefx-an-experiment-with-bezier-curves.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Pago &#8211; Sveriges Bästa Café</title>
		<link>http://www.x-com.se/produktioner/kampanjer#pago-sveriges-basta-cafe</link>
		<comments>http://www.x-com.se/produktioner/kampanjer#pago-sveriges-basta-cafe#comments</comments>
		<pubDate>Wed, 25 Aug 2010 08:05:45 +0000</pubDate>
		<dc:creator>Jani</dc:creator>
				<category><![CDATA[Kampanjer]]></category>

		<guid isPermaLink="false">http://www.x-com.se/?p=1213</guid>
		<description><![CDATA[För Spendrups Bryggeri har vi skapat en kampanj för deras ...]]></description>
			<content:encoded><![CDATA[<p>För Spendrups Bryggeri har vi skapat en kampanj för deras premiumjuice Pago. Kampanjen, som ska ligga på bilddagboken, går ut på att kora Sveriges Bästa Café.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/kampanjer#pago-sveriges-basta-cafe/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>X-Com + iPhone = Äntligen!</title>
		<link>http://www.x-com.se/aktuellt/x-com-iphone-antligen.html</link>
		<comments>http://www.x-com.se/aktuellt/x-com-iphone-antligen.html#comments</comments>
		<pubDate>Mon, 09 Aug 2010 15:08:23 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Aktuellt]]></category>

		<guid isPermaLink="false">http://www.x-com.se/?p=1205</guid>
		<description><![CDATA[Nu har vi äntligen släppt vår första iPhone app. Det ...]]></description>
			<content:encoded><![CDATA[<p><a href="http://itunes.apple.com/se/app/walters-app/id378084678?mt=8"><img class="alignright size-full wp-image-1086" title="Walters App" src="/wp-content/uploads/2010/08/waltersapp_300x340.jpg" alt="Walters App" width="300" height="340" /></a>Nu har vi äntligen släppt vår första iPhone app. Det är åt Torshällas stolthet och Sveriges roligaste nörd Walter Kurtsson som vi har tagit fram en iPhone App där du kan se filmer, lyssna på walters låtar, höra hans roliga “telefonluringar” och mycket mer. Den är gratis och du kan <a href="http://itunes.apple.com/se/app/walters-app/id378084678?mt=8">ladda hem Walters App här</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/aktuellt/x-com-iphone-antligen.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Walter Kurtsson &#8211; iPhone App</title>
		<link>http://www.x-com.se/produktioner/ovrigt#walter-kurtsson-iphone-app</link>
		<comments>http://www.x-com.se/produktioner/ovrigt#walter-kurtsson-iphone-app#comments</comments>
		<pubDate>Mon, 09 Aug 2010 14:40:23 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Övrigt]]></category>

		<guid isPermaLink="false">http://www.x-com.se#</guid>
		<description><![CDATA[Torshällas stolthet och Sveriges roligaste nörd Walter Kurtsson finns nu ...]]></description>
			<content:encoded><![CDATA[<p>Torshällas stolthet och Sveriges roligaste nörd Walter Kurtsson finns nu även i din iPhone. Här kan du se filmer, lyssna på walters låtar, höra hans roliga &#8220;telefonluringar&#8221; och mycket mer. Appen är gratis så ladda hem den nu!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/ovrigt#walter-kurtsson-iphone-app/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Realistic water &#8211; Showing off DisplacementMapFilter</title>
		<link>http://www.x-com.se/labs/flash/realistic-water-showing-off-displacementmapfilter.html</link>
		<comments>http://www.x-com.se/labs/flash/realistic-water-showing-off-displacementmapfilter.html#comments</comments>
		<pubDate>Thu, 15 Jul 2010 13:57:39 +0000</pubDate>
		<dc:creator>Andreas</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[displacementmap]]></category>
		<category><![CDATA[displacementmapfilter]]></category>
		<category><![CDATA[effect]]></category>
		<category><![CDATA[water]]></category>

		<guid isPermaLink="false">http://www.x-com.se/?p=1185</guid>
		<description><![CDATA[
Try moving the mouse over the water and maybe click ...]]></description>
			<content:encoded><![CDATA[<p><a rel="shadowbox;width=500;height=300" href="/wp-content/uploads/2010/07/water.swf"><img title="Water" src="/wp-content/uploads/2010/07/water_preview.png" alt="Water" width="600" height="340" /></a><br />
Try moving the mouse over the water and maybe click a few times?</p>
<p>Been playing around with a small idea of a game and for this particular game I would like to have a great top-down watereffect to give a smooth, calm overall feeling.<br />
<span id="more-1185"></span><br />
This was a great way to try out a few new tricks using both the DisplacementMapFilter that has been in Flash for a while and also the lesser known ConvolutionFilter.<br />
The DisplacementMapFilter helps to &#8220;push&#8221; the backgroundpixels in different directions due to the filtercolours which creates the distortion of the background, giving the illusion of the water breaking and distorting the light.<br />
The ConvolutionFilter is normally used to check and alter the neighbouring pixels which in this case is used when the water rings and ripples are growing and &#8220;smoothed&#8221; out. </p>
<p>On top of this, I created a bitmap using PerlinNoise that also distorts the water + gives that nice lighting effect via the SUBTRACT BlendMode.</p>
<p>The result became surprisingly good so I decided to throw it up here right away and will, as soon as I find the time, clean the code out so I can step through it all with you once it&#8217;s done.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/labs/flash/realistic-water-showing-off-displacementmapfilter.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tele2 &#8211; Playlist Quiz</title>
		<link>http://www.x-com.se/produktioner/webbplatser#tele2-playlist-quiz</link>
		<comments>http://www.x-com.se/produktioner/webbplatser#tele2-playlist-quiz#comments</comments>
		<pubDate>Wed, 14 Jul 2010 14:52:04 +0000</pubDate>
		<dc:creator>Jani</dc:creator>
				<category><![CDATA[Webbplatser]]></category>

		<guid isPermaLink="false">http://www.x-com.se/?p=1147</guid>
		<description><![CDATA[Tele2 Playlist Quiz baseras på Tele2:s nya musiktjänst Playlist som ...]]></description>
			<content:encoded><![CDATA[<p>Tele2 Playlist Quiz baseras på Tele2:s nya musiktjänst <a href="http://playlist.tele2.se">Playlist</a> som erbjuder nerladdning av låtar. Till denna musiktjänst har vi kopplat på en frågesportslek där besökaren själv får spela eller skapa quizar. Självklart kan man även utmana sina vänner på Facebook för att se vem som är bäst på musik!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/webbplatser#tele2-playlist-quiz/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>En vecka stängt i sommar</title>
		<link>http://www.x-com.se/aktuellt/en-vecka-stangt-i-sommar.html</link>
		<comments>http://www.x-com.se/aktuellt/en-vecka-stangt-i-sommar.html#comments</comments>
		<pubDate>Tue, 06 Jul 2010 16:48:55 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Aktuellt]]></category>

		<guid isPermaLink="false">http://www.x-com.se/?p=1144</guid>
		<description><![CDATA[Denna sommaren kommer vi bara hålla stängt v. 31 (2-6/8) ...]]></description>
			<content:encoded><![CDATA[<p>Denna sommaren kommer vi bara hålla stängt v. 31 (2-6/8) då alla är på semester. Övriga veckor kommer det vara någon på kontoret och från och med v. 33 (16-20/8) är alla tillbaka igen.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/aktuellt/en-vecka-stangt-i-sommar.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tenzingpriset &#8211; Webbplats</title>
		<link>http://www.x-com.se/produktioner/webbplatser#tenzingpriset-webbplats</link>
		<comments>http://www.x-com.se/produktioner/webbplatser#tenzingpriset-webbplats#comments</comments>
		<pubDate>Thu, 01 Jul 2010 11:42:39 +0000</pubDate>
		<dc:creator>Jani</dc:creator>
				<category><![CDATA[Webbplatser]]></category>

		<guid isPermaLink="false">http://www.x-com.se/?p=1172</guid>
		<description><![CDATA[Byrån Deasign har stått för design och vi har ansvarat ...]]></description>
			<content:encoded><![CDATA[<p>Byrån Deasign har stått för design och vi har ansvarat för programmering.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/webbplatser#tenzingpriset-webbplats/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ska vi få vårt första guldlejon?</title>
		<link>http://www.x-com.se/aktuellt/ska-vi-fa-vart-forsta-guldlejon.html</link>
		<comments>http://www.x-com.se/aktuellt/ska-vi-fa-vart-forsta-guldlejon.html#comments</comments>
		<pubDate>Wed, 23 Jun 2010 09:54:23 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Aktuellt]]></category>

		<guid isPermaLink="false">http://www.x-com.se/?p=1137</guid>
		<description><![CDATA[Just nu pågår reklam-VM i Cannes. En av produktionerna som ...]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-1086" title="cannes-lions-2010" src="/wp-content/uploads/2010/06/cannes_300x225.jpg" alt="Cannes Lions 2010" width="300" height="225" />Just nu pågår reklam-VM i Cannes. En av produktionerna som vi var delaktiga i förra året är med och tävlar om de åtråvärda guldlejonen i kategorin &#8220;Cyber&#8221;. Det är kampanjen <a href="http://www.x-com.se/produktioner#ikea-sveriges-trottaste-tavling">&#8220;IKEA &#8211; Sveriges Tröttaste Tävling&#8221;</a> som vi gjorde tillsammans med Forsman &#038; Bodenfors och B-Reel. På torsdag kväll avgörs det och vi kan inte annat än hoppas att kampanjen faller juryn i smaken.</p>
<p>Läs mer här: <a href="http://www.canneslions.com/work/cyber/entry.cfm?entryid=21663&#038;award=99" target="_blank">Cannes Lions International Advertising Festival</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/aktuellt/ska-vi-fa-vart-forsta-guldlejon.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Länsförsäkringar Älvsborg &#8211; Delägare</title>
		<link>http://www.x-com.se/produktioner/kampanjer#lansforsakringar-alvsborg-delagare</link>
		<comments>http://www.x-com.se/produktioner/kampanjer#lansforsakringar-alvsborg-delagare#comments</comments>
		<pubDate>Mon, 14 Jun 2010 09:49:55 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Kampanjer]]></category>

		<guid isPermaLink="false">http://www.x-com.se#</guid>
		<description><![CDATA[Tillsammans med reklambyrån Mecka i Borås har vi tagit fram ...]]></description>
			<content:encoded><![CDATA[<p>Tillsammans med reklambyrån Mecka i Borås har vi tagit fram en kampanjsajt för Länsförsäkringar Älvsborg. De vill lyfta fram att deras kunder även är delägare i bolaget. Den som laddar upp en bild på sig själv och får flest röster vinner sitt porträtt målat i olja av en riktig konstnär.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/kampanjer#lansforsakringar-alvsborg-delagare/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sony Ericsson &#8211; Xperia X10 Mini Serie</title>
		<link>http://www.x-com.se/produktioner/kampanjer#sony-ericsson-xperia-x10-mini-serie</link>
		<comments>http://www.x-com.se/produktioner/kampanjer#sony-ericsson-xperia-x10-mini-serie#comments</comments>
		<pubDate>Mon, 14 Jun 2010 09:06:57 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Kampanjer]]></category>

		<guid isPermaLink="false">http://www.x-com.se#</guid>
		<description><![CDATA[I samband med att Sony Ericsson lanserar sin nya Xperia ...]]></description>
			<content:encoded><![CDATA[<p>I samband med att Sony Ericsson lanserar sin nya Xperia X10 Mini har vi både designat och programmerat en kampanjsida som ligger på bilddagboken.se. Den som skapar den mest gillade serien vinner en ny Sony Ericsson Xperia X10 Mini.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/kampanjer#sony-ericsson-xperia-x10-mini-serie/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coca-Cola &#8211; My Longest Celebration</title>
		<link>http://www.x-com.se/produktioner/kampanjer#my-longest-celebration-by-coca-cola</link>
		<comments>http://www.x-com.se/produktioner/kampanjer#my-longest-celebration-by-coca-cola#comments</comments>
		<pubDate>Fri, 11 Jun 2010 09:03:58 +0000</pubDate>
		<dc:creator>Jani</dc:creator>
				<category><![CDATA[Kampanjer]]></category>

		<guid isPermaLink="false">http://www.x-com.se/?p=1107</guid>
		<description><![CDATA[Inför fotbolls-VM i Sydafrika har vi både kodat och designat ...]]></description>
			<content:encoded><![CDATA[<p>Inför fotbolls-VM i Sydafrika har vi både kodat och designat en kampanjsida för Coca-Cola. Kampanjsidan kommer finnas på Bilddagboken och går ut på att medlemmarna ska ladda upp bilder på sig själva och sprida glädjen!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/kampanjer#my-longest-celebration-by-coca-cola/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vi behöver bli fler!</title>
		<link>http://www.x-com.se/aktuellt/vi-behover-bli-fler.html</link>
		<comments>http://www.x-com.se/aktuellt/vi-behover-bli-fler.html#comments</comments>
		<pubDate>Fri, 28 May 2010 12:59:34 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Aktuellt]]></category>

		<guid isPermaLink="false">http://www.x-com.se/?p=1074</guid>
		<description><![CDATA[Just nu jobbar vi för högtryck och känner att det ...]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-1086" title="x-com-meeting" src="/wp-content/uploads/2010/05/x-com-meeting.jpg" alt="x-com-meeting" width="300" height="294" />Just nu jobbar vi för högtryck och känner att det inte skulle skada med lite förstärkning. Vi är alltid intresserade av att komma i kontakt med duktiga personer med olika kompetenser, men den här gången är vi speciellt intresserade av personer med följande profiler:</p>
<h2>Projektledare med säljinriktining</h2>
<p>- <a href="http://www.x-com.se/wp-content/uploads/2010/05/projektledare_100528.pdf" target="_blank">Läs mer om tjänsten här.</a></p>
<h2>Webbprogrammerare</h2>
<p>- <a href="http://www.x-com.se/wp-content/uploads/2010/05/webbprogrammerare_100528.pdf" target="_blank">Läs mer om tjänsten här.</a></p>
<p>Vi ser fram emot din ansökan!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/aktuellt/vi-behover-bli-fler.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eskilstuna Innerstad &#8211; Webbplats</title>
		<link>http://www.x-com.se/produktioner/webbplatser#eskilstuna-innerstad-webbplats</link>
		<comments>http://www.x-com.se/produktioner/webbplatser#eskilstuna-innerstad-webbplats#comments</comments>
		<pubDate>Fri, 28 May 2010 10:22:27 +0000</pubDate>
		<dc:creator>Jani</dc:creator>
				<category><![CDATA[Webbplatser]]></category>

		<guid isPermaLink="false">http://www.x-com.se/?p=1059</guid>
		<description><![CDATA[Vi har tagit fram en ny webbplats åt Eskilstuna Innerstad ...]]></description>
			<content:encoded><![CDATA[<p>Vi har tagit fram en ny webbplats åt Eskilstuna Innerstad som ska verka för en bättre innerstad. Vi har gjort både design och det tekniska. Sajten bygger på Open Source CMS:et <a href="http://www.umbraco.org" target="_blank">Umbraco</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/webbplatser#eskilstuna-innerstad-webbplats/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Auto generated branches</title>
		<link>http://www.x-com.se/labs/flash/auto-generated-branches.html</link>
		<comments>http://www.x-com.se/labs/flash/auto-generated-branches.html#comments</comments>
		<pubDate>Wed, 28 Apr 2010 09:53:20 +0000</pubDate>
		<dc:creator>Andreas</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.x-com.se/?p=1033</guid>
		<description><![CDATA[I want to create a nice 3D-effect with branches growing, ...]]></description>
			<content:encoded><![CDATA[<p>I want to create a nice 3D-effect with branches growing, flowing and rotating around each other. Just to make sure that my idea is working I decided just to create a proof of concept in 2D. With a few tweaks with the parameters it turned out to be some pretty nice organic trees/bushes.</p>
<p><a rel="shadowbox;width=900;height=400" href="/wp-content/uploads/2010/04/trees.swf"><img title="Trees" src="/wp-content/uploads/2010/04/treeGenerator.jpg" alt="Trees" width="600" height="340" /></a></p>
<p> I&#8217;ll go through the code and explain what it does.<br />
<span id="more-1033"></span></p>
<p>I divided the example into 3 classes. Main.as (just puts the trees on the stage), Tree.as (keeps track of all the branches, updates and destroys them and draws them to the canvas) and Branch.as (holds the information of one single branch).</p>
<p>I believe its easiest if we just start with the smallest component, the branch.</p>
<div class="codesnip-container-wrapper">
<div class="codesnip-container-innerwrapper">
<div class="codesnip-container" >
<div class="actionscript codesnip" style="font-family:monospace;">package <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> com.<span class="me1">greensock</span>.<span class="me1">TweenLite</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> se.<span class="me1">xcom</span>.<span class="kw3">math</span>.<span class="me1">Degrees</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">class</span> Branch<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">var</span> rotZ:<span class="kw3">Number</span>; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">var</span> rotZSpeed:<span class="kw3">Number</span> = <span class="nu0">0</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">var</span> x:<span class="kw3">Number</span>; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">var</span> y:<span class="kw3">Number</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">var</span> thickness:<span class="kw3">Number</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">var</span> speed:<span class="kw3">Number</span> = <span class="nu0">3</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">var</span> rotationSpeedSpan:<span class="kw3">Number</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">var</span> rotationSpeedFragility:<span class="kw3">Number</span> = <span class="nu0">0.2</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> Branch<span class="br0">&#40;</span>x:<span class="kw3">Number</span>,y:<span class="kw3">Number</span>,rotZ:<span class="kw3">Number</span>,thickness:<span class="kw3">Number</span>,rotationSpeedSpan:<span class="kw3">Number</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">this</span>.<span class="me1">x</span> = x;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">this</span>.<span class="me1">y</span> = y;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">this</span>.<span class="me1">rotZ</span> = rotZ;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">this</span>.<span class="me1">thickness</span> = thickness;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">this</span>.<span class="me1">rotationSpeedSpan</span> = rotationSpeedSpan;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setRotationSpeed<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> update<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; x += Degrees.<span class="me1">dSin</span><span class="br0">&#40;</span>rotZ<span class="br0">&#41;</span><span class="sy0">*</span>speed;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; y += Degrees.<span class="me1">dCos</span><span class="br0">&#40;</span>rotZ<span class="br0">&#41;</span><span class="sy0">*</span>speed;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rotZ += rotZSpeed;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; thickness-= <span class="nu0">0.04</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> destroy<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// kill the endless loop</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TweenLite.<span class="me1">killTweensOf</span><span class="br0">&#40;</span><span class="kw3">this</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">function</span> setRotationSpeed<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// To make sure that the rotation of the branch moves smoothly I decide not to tween the actual rotation but the speed of the rotation.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// This is an endless loop, calling itself when the tween has ended.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> newSpeed:<span class="kw3">Number</span> = <span class="kw3">Math</span>.<span class="kw3">random</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">*</span>rotationSpeedSpan-rotationSpeedSpan<span class="sy0">*</span>.5;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> delay:<span class="kw3">Number</span> = <span class="kw3">Math</span>.<span class="kw3">random</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">*</span>rotationSpeedFragility+rotationSpeedFragility<span class="sy0">*</span>.5;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TweenLite.<span class="me1">to</span><span class="br0">&#40;</span><span class="kw3">this</span>,delay,<span class="br0">&#123;</span>rotZSpeed:newSpeed,onComplete:setRotationSpeed<span class="br0">&#125;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
</div>
</div>
</div>
<p>As you can see, the branch is not a display object. It just carries the info about the branch so <strong>Tree.as</strong> can draw it on it&#8217;s graphics canvas. The <strong>update()</strong> function makes sure that the branch shrinks in thickness, rotates and grows in the current direction it is given. The rotation is is changed through the Tween in <strong>setRotationSpeed()</strong>. Really nothing special (oh and if you are wondering about the Degrees class, it&#8217;s just converting radians into degrees as I hate radians.) Let&#8217;s move on to the Tree.</p>
<div class="codesnip-container-wrapper">
<div class="codesnip-container-innerwrapper">
<div class="codesnip-container" >
<div class="actionscript codesnip" style="font-family:monospace;">package<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> com.<span class="me1">greensock</span>.<span class="me1">TweenLite</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">display</span>.<span class="me1">Sprite</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">events</span>.<span class="me1">Event</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">class</span> Tree <span class="kw3">extends</span> Sprite<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> <span class="kw3">color</span>:<span class="kw3">Number</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> aBranches:<span class="kw3">Array</span> = <span class="br0">&#91;</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> Tree<span class="br0">&#40;</span><span class="kw3">color</span>:<span class="kw3">Number</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">this</span>.<span class="kw3">color</span> = <span class="kw3">color</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; reset<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">super</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> <span class="kw3">start</span><span class="br0">&#40;</span>delay:<span class="kw3">int</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Just starts drawing the tree. Implanted only so the trees doesnt start drawing at the same time.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TweenLite.<span class="me1">delayedCall</span><span class="br0">&#40;</span>delay,<span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span>addEventListener<span class="br0">&#40;</span>Event.<span class="me1">ENTER_FRAME</span>,onTick<span class="br0">&#41;</span><span class="br0">&#125;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">function</span> onTick<span class="br0">&#40;</span><span class="kw3">e</span>:Event<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Goes through every branch in the tree.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="kw1">each</span><span class="br0">&#40;</span><span class="kw2">var</span> br:Branch <span class="kw1">in</span> aBranches<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Updates the branch and draws a new line between the old position and the new one.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">with</span> <span class="br0">&#40;</span><span class="kw3">this</span>.<span class="me1">graphics</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">lineStyle</span><span class="br0">&#40;</span>br.<span class="me1">thickness</span>,<span class="kw3">color</span>,1<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">moveTo</span><span class="br0">&#40;</span>br.<span class="me1">x</span>,br.<span class="me1">y</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; br.<span class="me1">update</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">lineTo</span><span class="br0">&#40;</span>br.<span class="me1">x</span>,br.<span class="me1">y</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Randomly decides wether to create a new branch origin from the current branch.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="kw3">Math</span>.<span class="kw3">random</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">&lt;</span> 0.1-<span class="br0">&#40;</span>br.<span class="me1">thickness</span><span class="sy0">*</span>0.01<span class="br0">&#41;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> th:<span class="kw3">int</span> = <span class="br0">&#40;</span>br.<span class="me1">thickness</span><span class="sy0">&gt;</span>0.7<span class="br0">&#41;</span>?<span class="br0">&#40;</span>br.<span class="me1">thickness</span>-1<span class="br0">&#41;</span>:br.<span class="me1">thickness</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> tbr:Branch = <span class="kw2">new</span> Branch<span class="br0">&#40;</span>br.<span class="me1">x</span>,br.<span class="me1">y</span>,br.<span class="me1">rotZ</span>,th,br.<span class="me1">rotationSpeedSpan</span>+14<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aBranches.<span class="kw3">push</span><span class="br0">&#40;</span>tbr<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Goes through every branch in the tree (again!) just to destroy the branches that are too small.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw2">var</span> i:<span class="kw3">int</span>= aBranches.<span class="me1">length</span>-<span class="nu0">1</span>;i <span class="sy0">&gt;</span> -<span class="nu0">1</span>;i&#8211;<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> tbr:Branch = aBranches<span class="br0">&#91;</span>i<span class="br0">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>tbr.<span class="me1">thickness</span> <span class="sy0">&lt;</span> 0.4<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tbr.<span class="me1">destroy</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aBranches.<span class="kw3">splice</span><span class="br0">&#40;</span>i,<span class="nu0">1</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Checks if there are no &quot;alive&quot; branches left.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>aBranches.<span class="kw3">length</span> == 0<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TweenLite.<span class="me1">to</span><span class="br0">&#40;</span><span class="kw3">this</span>,2,<span class="br0">&#123;</span>alpha:0,onComplete:reset<span class="br0">&#125;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">function</span> reset<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">this</span>.<span class="me1">graphics</span>.<span class="kw3">clear</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; alpha = <span class="nu0">1</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> tbr:Branch = <span class="kw2">new</span> Branch<span class="br0">&#40;</span>0,0,180,8,5<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aBranches.<span class="kw3">push</span><span class="br0">&#40;</span>tbr<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
</div>
</div>
</div>
<p>As you can see, <strong>start()</strong> sets an Event.ENTER_FRAME listener so it automatically runs <strong>onTick()</strong> every frame. Most of the comments in the code tells you whats happening inside. It takes all the branches it currently has, updates them, draws them, sometimes spawns new branches and finally removes them if their thickness is, well not thick enough.</p>
<p>Only the Main.as class remains. I guess it need&#8217;s no comments. </p>
<div class="codesnip-container-wrapper">
<div class="codesnip-container-innerwrapper">
<div class="codesnip-container" >
<div class="actionscript codesnip" style="font-family:monospace;">package <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">display</span>.<span class="me1">Sprite</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">class</span> Main <span class="kw3">extends</span> Sprite<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> aTrees:<span class="kw3">Array</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> aColors:<span class="kw3">Array</span>=<span class="br0">&#91;</span>0xffbb88,0xaaffaa,0xaabbff<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> aBranches:<span class="kw3">Array</span> &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> Main<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span> &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw2">var</span> i:<span class="kw3">int</span> = <span class="nu0">0</span>;i<span class="sy0">&lt;</span><span class="nu0">3</span>;i++<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> tree:Tree = <span class="kw2">new</span> Tree<span class="br0">&#40;</span>aColors<span class="br0">&#91;</span>i<span class="br0">&#93;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tree.<span class="me1">x</span> = 250<span class="sy0">*</span>i+<span class="nu0">200</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tree.<span class="me1">y</span> = <span class="nu0">370</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tree.<span class="kw3">start</span><span class="br0">&#40;</span>i<span class="sy0">*</span>3.5<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addChild<span class="br0">&#40;</span>tree<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
</div>
</div>
</div>
<p>There you go, three tiny trees growing on your screen. There are lots of parameters that could be lifted out and tweaked with giving you more branches, faster drawing, stranger rotation of the branches and so on. But I leave it up to you to lift them out and customize the classes. </p>
<p>/Andreas</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/labs/flash/auto-generated-branches.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ViewportLayers &#8211; In depth (Papervision3D)</title>
		<link>http://www.x-com.se/labs/flash/viewportlayers-in-depth-papervision3d.html</link>
		<comments>http://www.x-com.se/labs/flash/viewportlayers-in-depth-papervision3d.html#comments</comments>
		<pubDate>Wed, 21 Apr 2010 12:12:53 +0000</pubDate>
		<dc:creator>Andreas</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.x-com.se/?p=1005</guid>
		<description><![CDATA[The more I see where people get stuck, using PV3D, ...]]></description>
			<content:encoded><![CDATA[<p>The more I see where people get stuck, using PV3D, the more I feel the need to create a good tutorial regarding ViewportLayers.<br />
Lets start with the simple task of NOT using any layers. First the document class that just adds our BasicView.<br />
<span id="more-1005"></span></p>
<div class="codesnip-container-wrapper">
<div class="codesnip-container-innerwrapper">
<div class="codesnip-container" >
<div class="actionscript codesnip" style="font-family:monospace;">package <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">display</span>.<span class="me1">Sprite</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">class</span> ViewportLayerTest <span class="kw3">extends</span> Sprite<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> ViewportLayerTest<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> tView:View3d = <span class="kw2">new</span> View3d<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addChild<span class="br0">&#40;</span>tView<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
</div>
</div>
</div>
<p>Now let’s build up a scene with a ground, a wall stuck to the ground and a sphere that is stuck right in the middle of the wall.<br />
That would look something like this.</p>
<div class="codesnip-container-wrapper">
<div class="codesnip-container-innerwrapper">
<div class="codesnip-container" >
<div class="actionscript codesnip" style="font-family:monospace;">package<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw3">import</span> org.<span class="me1">papervision3d</span>.<span class="me1">materials</span>.<span class="me1">WireframeMaterial</span>;<br />
&nbsp; &nbsp; <span class="kw3">import</span> org.<span class="me1">papervision3d</span>.<span class="me1">objects</span>.<span class="me1">primitives</span>.<span class="me1">Cube</span>;<br />
&nbsp; &nbsp; <span class="kw3">import</span> org.<span class="me1">papervision3d</span>.<span class="me1">objects</span>.<span class="me1">primitives</span>.<span class="me1">Plane</span>;<br />
&nbsp; &nbsp; <span class="kw3">import</span> org.<span class="me1">papervision3d</span>.<span class="me1">objects</span>.<span class="me1">primitives</span>.<span class="me1">Sphere</span>;<br />
&nbsp; &nbsp; <span class="kw3">import</span> org.<span class="me1">papervision3d</span>.<span class="me1">view</span>.<span class="me1">BasicView</span>;</p>
<p>&nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">class</span> View3d <span class="kw3">extends</span> BasicView<br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> sphere:Sphere;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> cube:Cube;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> ground:Plane;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> wall:Plane;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> View3d<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">super</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setupScene<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; startRendering<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">function</span> setupScene<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">camera</span>.<span class="me1">x</span> = <span class="nu0">660</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">camera</span>.<span class="me1">y</span> = &nbsp;<span class="nu0">400</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">camera</span>.<span class="me1">z</span> = -<span class="nu0">700</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ground = <span class="kw2">new</span> Plane<span class="br0">&#40;</span><span class="kw2">new</span> WireframeMaterial<span class="br0">&#40;</span>0&#215;224422<span class="br0">&#41;</span>,1000,1000,1,1<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ground.<span class="me1">rotationX</span> = <span class="nu0">90</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; wall = <span class="kw2">new</span> Plane<span class="br0">&#40;</span><span class="kw2">new</span> WireframeMaterial<span class="br0">&#40;</span>0&#215;556655<span class="br0">&#41;</span>,1000,400,1,1<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; wall.<span class="me1">y</span> = <span class="nu0">200</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sphere = <span class="kw2">new</span> Sphere<span class="br0">&#40;</span><span class="kw2">new</span> WireframeMaterial<span class="br0">&#40;</span>0xff2222<span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sphere.<span class="me1">x</span> = -<span class="nu0">100</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sphere.<span class="me1">y</span> = <span class="nu0">100</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scene.<span class="me1">addChild</span><span class="br0">&#40;</span>ground<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scene.<span class="me1">addChild</span><span class="br0">&#40;</span>wall<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scene.<span class="me1">addChild</span><span class="br0">&#40;</span>sphere<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
</div>
</div>
</div>
<p>Run that swf and you will see this:<br />
<img class="alignnone size-full wp-image-1011" title="bild-11" src="http://www.x-com.se/wp-content/uploads/2010/04/bild-11.png" alt="bild-11" width="508" height="390" /></p>
<p>Let us now put a little more code in and also change the material into solid colour ones (I put a FlastShader on the sphere so we can see the roundness more easily).</p>
<div class="codesnip-container-wrapper">
<div class="codesnip-container-innerwrapper">
<div class="codesnip-container" >
<div class="actionscript codesnip" style="font-family:monospace;">package<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> org.<span class="me1">papervision3d</span>.<span class="me1">lights</span>.<span class="me1">PointLight3D</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> org.<span class="me1">papervision3d</span>.<span class="me1">materials</span>.<span class="me1">ColorMaterial</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> org.<span class="me1">papervision3d</span>.<span class="me1">materials</span>.<span class="me1">shadematerials</span>.<span class="me1">FlatShadeMaterial</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> org.<span class="me1">papervision3d</span>.<span class="me1">objects</span>.<span class="me1">primitives</span>.<span class="me1">Cube</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> org.<span class="me1">papervision3d</span>.<span class="me1">objects</span>.<span class="me1">primitives</span>.<span class="me1">Plane</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> org.<span class="me1">papervision3d</span>.<span class="me1">objects</span>.<span class="me1">primitives</span>.<span class="me1">Sphere</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> org.<span class="me1">papervision3d</span>.<span class="me1">view</span>.<span class="me1">BasicView</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">class</span> View3d <span class="kw3">extends</span> BasicView<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> light:PointLight3D;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> sphere:Sphere;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> cube:Cube;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> ground:Plane;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> wall:Plane;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> View3d<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">super</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setupScene<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; startRendering<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">function</span> setupScene<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">camera</span>.<span class="me1">x</span> = <span class="nu0">660</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">camera</span>.<span class="me1">y</span> = &nbsp;<span class="nu0">400</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">camera</span>.<span class="me1">z</span> = -<span class="nu0">700</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; light = <span class="kw2">new</span> PointLight3D<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; light.<span class="me1">x</span> = -<span class="nu0">400</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; light.<span class="me1">z</span> = -<span class="nu0">1000</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; light.<span class="me1">y</span> = <span class="nu0">200</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ground = <span class="kw2">new</span> Plane<span class="br0">&#40;</span><span class="kw2">new</span> ColorMaterial<span class="br0">&#40;</span>0&#215;224422<span class="br0">&#41;</span>,1000,1000,1,1<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ground.<span class="me1">rotationX</span> = <span class="nu0">90</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; wall = <span class="kw2">new</span> Plane<span class="br0">&#40;</span><span class="kw2">new</span> ColorMaterial<span class="br0">&#40;</span>0&#215;446644<span class="br0">&#41;</span>,800,400,1,1<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; wall.<span class="me1">y</span> = <span class="nu0">200</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sphere = <span class="kw2">new</span> Sphere<span class="br0">&#40;</span><span class="kw2">new</span> FlatShadeMaterial<span class="br0">&#40;</span>light,0xff2222<span class="br0">&#41;</span>,100,10,10<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sphere.<span class="me1">x</span> = -<span class="nu0">100</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sphere.<span class="me1">y</span> = <span class="nu0">100</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scene.<span class="me1">addChild</span><span class="br0">&#40;</span>ground<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scene.<span class="me1">addChild</span><span class="br0">&#40;</span>wall<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scene.<span class="me1">addChild</span><span class="br0">&#40;</span>sphere<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
</div>
</div>
</div>
<p>Run it and witness this:</p>
<p><img class="alignnone size-full wp-image-1008" title="bild-2" src="http://www.x-com.se/wp-content/uploads/2010/04/bild-2.png" alt="bild-2" width="510" height="391" /></p>
<p>Now that aint right! This is just the Z-fighting I talked about in an earlier post. Looking at the wireframe one can see that the “centerpoint” of the left triangle in the ground is actually closer to the than many of the sphere and walls centrepoint so that is why we get that strange phenomena. It just is drawn later than it should.</p>
<p>Now lets use layers just like in Flash 2D. (well sort of).</p>
<h2>What are ViewportLayers?</h2>
<p>As I assume that you are familiar to the Flash environment and AS3, I will descripe the ViewportLayers just like layered movieclips on top of each other in a normal DisplayList. The Viewport is rendering all these layers one by one in the order it is told to which gives you the power to control when something is going to be rendered.</p>
<p>Now, the PV3D team has been very ambitious when it comes to layers and therefo you will find many different ways of creating one or even handling one.</p>
<p>First of all, let me say that we already got 2 layers. One is the actual Viewport.containerSprite that is the “root” of every layer.</p>
<p>If we write</p>
<p><strong><em>trace(viewport.containerSprite.childLayers.toString());</em></strong></p>
<p>you will see a layer underneath as well. This is what we got this far.</p>
<p>One approach to working with layers is to just set up a structure of empty layers at first and then fill in the objects that needs to be in which layer.</p>
<p>Let’s try this on our testscene. Put this script after you add the objects to the scene:</p>
<div class="codesnip-container-wrapper">
<div class="codesnip-container-innerwrapper">
<div class="codesnip-container" >
<div class="actionscript codesnip" style="font-family:monospace;"><span class="co1">// create 3 new layers, null says that it will be empty initially.</span><br />
<span class="kw2">var</span> sphereLayer:ViewportLayer = <span class="kw2">new</span> ViewportLayer<span class="br0">&#40;</span>viewport,<span class="kw2">null</span><span class="br0">&#41;</span>;<br />
<span class="kw2">var</span> wallLayer:ViewportLayer = <span class="kw2">new</span> ViewportLayer<span class="br0">&#40;</span>viewport,<span class="kw2">null</span><span class="br0">&#41;</span>;<br />
<span class="kw2">var</span> groundLayer:ViewportLayer = <span class="kw2">new</span> ViewportLayer<span class="br0">&#40;</span>viewport,<span class="kw2">null</span><span class="br0">&#41;</span>;</p>
<p><span class="co1">// add the layers as childs to the &quot;root&quot;-layer</span><br />
viewport.<span class="me1">containerSprite</span>.<span class="me1">addLayer</span><span class="br0">&#40;</span>sphereLayer<span class="br0">&#41;</span>;<br />
viewport.<span class="me1">containerSprite</span>.<span class="me1">addLayer</span><span class="br0">&#40;</span>wallLayer<span class="br0">&#41;</span>;<br />
viewport.<span class="me1">containerSprite</span>.<span class="me1">addLayer</span><span class="br0">&#40;</span>groundLayer<span class="br0">&#41;</span>;</p>
<p><span class="co1">// set the sorting of all childlayers to sort by index</span><br />
viewport.<span class="me1">containerSprite</span>.<span class="me1">sortMode</span> = ViewportLayerSortMode.<span class="me1">INDEX_SORT</span>;</p>
<p><span class="co1">// set the sort index of the new layer</span><br />
groundLayer.<span class="me1">layerIndex</span> = <span class="nu0">1</span>;<br />
wallLayer.<span class="me1">layerIndex</span> = <span class="nu0">2</span>;<br />
sphereLayer.<span class="me1">layerIndex</span> = <span class="nu0">3</span>;</p>
<p><span class="co1">// add our objects to the new layers</span><br />
groundLayer.<span class="me1">addDisplayObject3D</span><span class="br0">&#40;</span>ground<span class="br0">&#41;</span>;<br />
wallLayer.<span class="me1">addDisplayObject3D</span><span class="br0">&#40;</span>wall<span class="br0">&#41;</span>;<br />
sphereLayer.<span class="me1">addDisplayObject3D</span><span class="br0">&#40;</span>sphere<span class="br0">&#41;</span>;</div>
</div>
</div>
</div>
<p>And here’s the result:</p>
<p><img class="alignnone size-full wp-image-1009" title="bild-3" src="http://www.x-com.se/wp-content/uploads/2010/04/bild-3.png" alt="bild-3" width="508" height="390" /></p>
<p>Now the layers are like 3 “sprites” drawn separately on the viewport. First the ground (as it has the lowest index), then the wall, overwriting all of the ground. Finally the sphere. Notice that even though the sphere was half stuck into the wall, we can see the whole sphere now.<br />
As you can put “childLayers” in other layers you can also experiment with nesting layers into each other and sorting them differently depending on your needs.<br />
As I mentioned there are several approaches to creating layers.<br />
If you just erase what we just added we will try another approach.</p>
<div class="codesnip-container-wrapper">
<div class="codesnip-container-innerwrapper">
<div class="codesnip-container" >
<div class="actionscript codesnip" style="font-family:monospace;"><span class="co1">// this time, let&#8217;s use the viewport to create layers, through objects.</span><br />
<span class="co1">// true means that if &#8217;sphere&#8217; does not belong to a layer, create one for it and put it there.</span><br />
<span class="kw2">var</span> sphereLayer:ViewportLayer = viewport.<span class="me1">getChildLayer</span><span class="br0">&#40;</span>sphere, <span class="kw2">true</span><span class="br0">&#41;</span>;<br />
<span class="kw2">var</span> groundLayer:ViewportLayer = viewport.<span class="me1">getChildLayer</span><span class="br0">&#40;</span>sphere, <span class="kw2">true</span><span class="br0">&#41;</span>;<br />
<span class="kw2">var</span> wallLayer:ViewportLayer = viewport.<span class="me1">getChildLayer</span><span class="br0">&#40;</span>sphere, <span class="kw2">true</span><span class="br0">&#41;</span>;<br />
viewport.<span class="me1">containerSprite</span>.<span class="me1">sortMode</span> = ViewportLayerSortMode.<span class="me1">INDEX_SORT</span>;</p>
<p><span class="co1">// set the sort index of the new layer</span><br />
groundLayer.<span class="me1">layerIndex</span> = <span class="nu0">2</span>;<br />
wallLayer.<span class="me1">layerIndex</span> = <span class="nu0">1</span>;<br />
sphereLayer.<span class="me1">layerIndex</span> = <span class="nu0">3</span>;</div>
</div>
</div>
</div>
<p>As I changed the indexorder, the result now looks like this:<br />
<img class="alignnone size-full wp-image-1010" title="bild-4" src="http://www.x-com.se/wp-content/uploads/2010/04/bild-4.png" alt="bild-4" width="510" height="392" /></p>
<p>Notice that<strong><em> viewport.getChildLayer()</em></strong> does create a new layer, put the object in it and also puts the layer in the structurelist of the containerSprite. Easy and simple, but maybe with a little less control of the layers placement in the “layertree”.<br />
A last way of creating layers I want to bring up today is the DO3D.useOwnContainer<br />
It automatically creates a layer for just that object which gives you great control over effects like:<br />
<strong>DO3D.filters<br />
DO3D.blendMode<br />
DO3D.alpha</strong><br />
Try to set this simple variable to true and experiment with these 3 parameters. I know that people are asking a lot about alpha and effects and this is such an easy way to get that.</p>
<p>As long as you think of the layers as single Sprites/MovieClips on top of each other you will be able to come up with great effects. Are you having a problem getting a great buttonMode on all your objects? Put them in a layer and call:<strong><em> layer.buttonMode = true</em></strong></p>
<p>You want some of your cubes to glow? Why don’t you try <em><strong>layer.Filters</strong></em>?</p>
<p>You even have unique control over how OFTEN that special layer will be rendered. In my game I will consider a static overview camera for lowperformance computers. This means that I will only render the ground and the whole Arena ONCE and then only render the units, bullets and explosions. Really a processorsaver! How to do it?</p>
<p>Well, put all layers that will be rendered into an array, eg aLayers:Array</p>
<p>Now send that array into: renderer.renderLayers(scene, camera, viewport, aLayers)</p>
<p>This will tell the renderer to only render those layers.</p>
<p>ViewportLayers holds a lot of secrets and great functionality but I stop here and will probably come out with a more advanced tutorial later on. Now you got the basics to take control over your renderings!</p>
<p>/Andreas</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/labs/flash/viewportlayers-in-depth-papervision3d.html/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Particle system #1 &#8211; Basic particles</title>
		<link>http://www.x-com.se/labs/flash/particle-system-1-basic-particles.html</link>
		<comments>http://www.x-com.se/labs/flash/particle-system-1-basic-particles.html#comments</comments>
		<pubDate>Mon, 19 Apr 2010 13:58:05 +0000</pubDate>
		<dc:creator>Andreas</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.x-com.se/?p=989</guid>
		<description><![CDATA[As I am coming from a background of gameprogramming (and ...]]></description>
			<content:encoded><![CDATA[<p>As I am coming from a background of gameprogramming (and originally from the demo scene in the 90´s) am I very fond of small tips and tricks to create nice special effects. There are few project that I see out there that couldn&#8217;t be spiced up with a nice particle system so I decided to go through some basics of particle systems and how they can be used to create a variety of effects. In this first &#8220;chapter&#8221; I will just go through the basics of a system and how it works and then later on create a more flexible system that can be used in oh so many situations.</p>
<p>Now lets look at what we will create today:</p>
<p><a rel="shadowbox;width=450;height=450" href="/wp-content/uploads/2010/04/supernova.swf"><img title="facewarp" src="/wp-content/uploads/2010/04/supernova.jpg" alt="Facewarp" width="600" height="340" /></a></p>
<p>Neat right? Let&#8217;s dive into the universe of particles&#8230;<br />
<span id="more-989"></span></p>
<p>For a programmer used to flash (which is a very &#8220;visual&#8221; language) it&#8217;s not especially hard to understand the concept of particles as it is nothing less than Displayobjects being placed on screen and adjusted using it&#8217;s normal parameters such as scale, rotation, color and position. In this exampel you see two different particle systems. One with the stars, adjusting their scale, alpha and position to create the illusion of the camera travelling forward in an endless space. The other system is the supernova with a few &#8220;particles&#8221; being placed in the center, scaled, rotated and then fading out with the alpha. Everything is blended with the awesome ADD-blendmode which must be the most used blendmode in any game/demo with some self respect. Both these systems origins from the center of the scene/stage so the Main class of this small app is probably very basic.</p>
<div class="codesnip-container-wrapper">
<div class="codesnip-container-innerwrapper">
<div class="codesnip-container" >
<div class="actionscript codesnip" style="font-family:monospace;">package<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">display</span>.<span class="me1">Sprite</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> se.<span class="me1">xcom</span>.<span class="me1">effects</span>.<span class="me1">particle</span>.<span class="me1">NovaEmitter</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> se.<span class="me1">xcom</span>.<span class="me1">effects</span>.<span class="me1">particle</span>.<span class="me1">StarEmitter</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">class</span> LiteTest <span class="kw3">extends</span> Sprite<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> LiteTest<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">super</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// create the emitters and adding it to the middle of scene.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> nova:NovaEmitter = <span class="kw2">new</span> NovaEmitter<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nova.<span class="me1">x</span> = <span class="kw3">stage</span>.<span class="me1">stageWidth</span><span class="sy0">*</span>.5;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nova.<span class="me1">y</span> = <span class="kw3">stage</span>.<span class="me1">stageHeight</span><span class="sy0">*</span>.5;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nova.<span class="me1">scaleX</span> = <span class="nu0">2</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nova.<span class="me1">scaleY</span> = <span class="nu0">2</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> stars:StarEmitter = <span class="kw2">new</span> StarEmitter<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stars.<span class="me1">x</span> = <span class="kw3">stage</span>.<span class="me1">stageWidth</span><span class="sy0">*</span>.5;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stars.<span class="me1">y</span> = <span class="kw3">stage</span>.<span class="me1">stageHeight</span><span class="sy0">*</span>.5;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addChild<span class="br0">&#40;</span>nova<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addChild<span class="br0">&#40;</span>stars<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
</div>
</div>
</div>
<p>Ok, lets take a look at one of the systems. All particle systems have some kind of &#8220;emitter&#8221;. You can see it as an object on the scene that is producing particles. It is  not visible itself but the particles it &#8220;emits&#8221; is (most of the time) visible. The emitter is somehow the engine that decides how many particles is being generated, how they behave, rotate, scale etc..  You can see it as a located factory in the screen producing particles. Sometimes it shoots the particles out from the center of itself (just like nova in this example) but it could on the other hand let particles be spawned all around itself just like the stars system.</p>
<div class="codesnip-container-wrapper">
<div class="codesnip-container-innerwrapper">
<div class="codesnip-container" >
<div class="actionscript codesnip" style="font-family:monospace;">package se.<span class="me1">xcom</span>.<span class="me1">effects</span>.<span class="me1">particle</span><br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">display</span>.<span class="me1">BlendMode</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">display</span>.<span class="me1">Sprite</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">events</span>.<span class="me1">TimerEvent</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">utils</span>.<span class="me1">Timer</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> gs.<span class="me1">TweenMax</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> gs.<span class="me1">easing</span>.<span class="me1">Linear</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">class</span> NovaEmitter <span class="kw3">extends</span> Sprite<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> emitTimer:Timer<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Time until next particle is emitted (ms).</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw3">static</span> const EMIT_TIME:<span class="kw3">Number</span> = 1500<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> NovaEmitter<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">super</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; emitTimer = <span class="kw2">new</span> Timer<span class="br0">&#40;</span>EMIT_TIME<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; emitTimer.<span class="me1">addEventListener</span><span class="br0">&#40;</span>TimerEvent.<span class="me1">TIMER</span>,onTimer<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; emitTimer.<span class="kw3">start</span><span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// creating a few particles to begin with.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw2">var</span> i:uint=<span class="nu0">0</span>;i <span class="sy0">&lt;</span> <span class="nu0">5</span>;i++<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; createParticle<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> onTimer<span class="br0">&#40;</span><span class="kw3">e</span>:TimerEvent<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; createParticle<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">function</span> createParticle<span class="br0">&#40;</span>prog:<span class="kw3">Number</span> = 0<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> part:Sprite = <span class="kw2">new</span> Particle<span class="br0">&#40;</span><span class="br0">&#41;</span> &nbsp;<span class="co1">// is a simple bitmap in flash library converted as a Sprite.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// modifying particle.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; part.<span class="me1">rotation</span> = <span class="kw3">Math</span>.<span class="kw3">random</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">*</span>360<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; part.<span class="me1">scaleX</span> = part.<span class="me1">scaleY</span> = 0.3+<span class="kw3">Math</span>.<span class="kw3">random</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">*</span>0.3<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; part.<span class="me1">blendMode</span> = BlendMode.<span class="kw3">ADD</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; part.<span class="me1">alpha</span> = 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> <span class="kw3">time</span>:<span class="kw3">Number</span> = <span class="kw3">Math</span>.<span class="kw3">random</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">*</span>7+5<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> rot:<span class="kw3">Number</span> = <span class="kw3">Math</span>.<span class="kw3">random</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">*</span>180-90<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> scale:<span class="kw3">Number</span> = <span class="kw3">Math</span>.<span class="kw3">random</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">*</span>1.6+0.6<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> posX:<span class="kw3">Number</span> = <span class="kw3">Math</span>.<span class="kw3">random</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">*</span>50-25<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> posY:<span class="kw3">Number</span> = <span class="kw3">Math</span>.<span class="kw3">random</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">*</span>50-25<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addChild<span class="br0">&#40;</span>part<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TweenMax.<span class="me1">to</span><span class="br0">&#40;</span>part,<span class="kw3">time</span>,<span class="br0">&#123;</span>x:posX,y:posY,rotation:<span class="kw3">String</span><span class="br0">&#40;</span>rot<span class="br0">&#41;</span>,scaleX:scale,scaleY:scale,ease:Linear.<span class="me1">easeOut</span>, onComplete:killParticle,onCompleteParams:<span class="br0">&#91;</span>part<span class="br0">&#93;</span><span class="br0">&#125;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TweenMax.<span class="me1">to</span><span class="br0">&#40;</span>part,<span class="kw3">time</span><span class="sy0">/</span>4,<span class="br0">&#123;</span>alpha:1,overwrite:<span class="kw2">false</span><span class="br0">&#125;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TweenMax.<span class="me1">to</span><span class="br0">&#40;</span>part,<span class="kw3">time</span><span class="sy0">*</span>2<span class="sy0">/</span>3,<span class="br0">&#123;</span>delay:<span class="kw3">time</span><span class="sy0">/</span>3,alpha:0,overwrite:<span class="kw2">false</span><span class="br0">&#125;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">function</span> killParticle<span class="br0">&#40;</span>obj:Sprite<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">this</span>.<span class="me1">removeChild</span><span class="br0">&#40;</span>obj<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; obj = <span class="kw2">null</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
</div>
</div>
</div>
<p>As you can see the Nova-system creates a new particle every 1.5 sec. It sets a lot of random parameters for the sprite and then just tweens it using the badass library TweenMax (which can be found <a title="TweenMax" href="http://www.greensock.com/tweenmax/">here.</a> and then destroy&#8217;s itself neatly afterwards. Straightforward huh? The secret with the fluid animation of the nova is mostly because of the blendmode that I previously mentioned.<br />
ADD does exactly what it says. It adds two colours (their rgb-values) into one. this is great for oh so many purposes. First of all it never gives you any black corners as if it&#8217;s black, it just shows the colour behind. Also it is a great way to mask out an effect with a black background without using alphachannels. In fact this is a much faster way for the processor to handle masking than alphachannels are. </p>
<p>Now let&#8217;s look at the stars. They are not different at all.</p>
<div class="codesnip-container-wrapper">
<div class="codesnip-container-innerwrapper">
<div class="codesnip-container" >
<div class="actionscript codesnip" style="font-family:monospace;">package se.<span class="me1">xcom</span>.<span class="me1">effects</span>.<span class="me1">particle</span><br />
<span class="br0">&#123;</span><br />
<span class="kw3">import</span> flash.<span class="me1">display</span>.<span class="me1">BlendMode</span>;<br />
<span class="kw3">import</span> flash.<span class="me1">display</span>.<span class="me1">Sprite</span>;<br />
<span class="kw3">import</span> flash.<span class="me1">events</span>.<span class="me1">TimerEvent</span>;<br />
<span class="kw3">import</span> flash.<span class="me1">utils</span>.<span class="me1">Timer</span>;</p>
<p><span class="kw3">import</span> gs.<span class="me1">TweenMax</span>;<br />
<span class="kw3">import</span> gs.<span class="me1">easing</span>.<span class="me1">Quad</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">class</span> StarEmitter <span class="kw3">extends</span> Sprite<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> emitTimer:Timer<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw3">static</span> const STAR_TIME:<span class="kw3">Number</span> = 4<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw3">static</span> const EMIT_TIME:<span class="kw3">Number</span> = 1<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> StarEmitter<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">super</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; emitTimer = <span class="kw2">new</span> Timer<span class="br0">&#40;</span>EMIT_TIME<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; emitTimer.<span class="me1">addEventListener</span><span class="br0">&#40;</span>TimerEvent.<span class="me1">TIMER</span>,onTimer<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; emitTimer.<span class="kw3">start</span><span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// initiating with some stars</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw2">var</span> i:uint=<span class="nu0">0</span>;i <span class="sy0">&lt;</span> <span class="nu0">40</span>;i++<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; createParticle<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> onTimer<span class="br0">&#40;</span><span class="kw3">e</span>:TimerEvent<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw2">var</span> i:uint=<span class="nu0">0</span>;i <span class="sy0">&lt;</span> <span class="nu0">3</span>;i++<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; createParticle<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">function</span> createParticle<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> part:Sprite = <span class="kw2">new</span> Star<span class="br0">&#40;</span><span class="br0">&#41;</span> &nbsp;<span class="co1">// is a simple bitmap in flash library converted as a Sprite.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// modifying particle.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> z:<span class="kw3">Number</span> = <span class="kw3">Math</span>.<span class="kw3">random</span><span class="br0">&#40;</span><span class="br0">&#41;</span>; &nbsp;<span class="co1">// z = 1 means it is in the same Z as the camera</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> posX:<span class="kw3">Number</span> = <span class="br0">&#40;</span><span class="kw3">Math</span>.<span class="kw3">random</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">*</span>1500-750<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> posY:<span class="kw3">Number</span> = <span class="br0">&#40;</span><span class="kw3">Math</span>.<span class="kw3">random</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">*</span>1500-750<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; part.<span class="me1">blendMode</span> = BlendMode.<span class="kw3">ADD</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; part.<span class="me1">alpha</span> = 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; part.<span class="me1">scaleX</span> = part.<span class="me1">scaleY</span> =0<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; part.<span class="me1">x</span> = posX<span class="sy0">*</span>z<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; part.<span class="me1">y</span> = posY<span class="sy0">*</span>z<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addChild<span class="br0">&#40;</span>part<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> t:<span class="kw3">Number</span> = STAR_TIME<span class="sy0">*</span><span class="br0">&#40;</span>1-z<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> endScale:<span class="kw3">Number</span> = <span class="kw3">Math</span>.<span class="kw3">random</span><span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TweenMax.<span class="me1">to</span><span class="br0">&#40;</span>part,t,<span class="br0">&#123;</span>x:posX,y:posY,scaleX:endScale,scaleY:endScale,ease:Quad.<span class="me1">easeIn</span>, onComplete:killParticle,onCompleteParams:<span class="br0">&#91;</span>part<span class="br0">&#93;</span><span class="br0">&#125;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TweenMax.<span class="me1">to</span><span class="br0">&#40;</span>part,t<span class="sy0">/</span>2,<span class="br0">&#123;</span>alpha:1,overwrite:<span class="kw2">false</span><span class="br0">&#125;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TweenMax.<span class="me1">to</span><span class="br0">&#40;</span>part,t<span class="sy0">*</span>1<span class="sy0">/</span>2,<span class="br0">&#123;</span>delay:t<span class="sy0">*</span>1<span class="sy0">/</span>2,alpha:0,overwrite:<span class="kw2">false</span><span class="br0">&#125;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">function</span> killParticle<span class="br0">&#40;</span>obj:Sprite<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">this</span>.<span class="me1">removeChild</span><span class="br0">&#40;</span>obj<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; obj = <span class="kw2">null</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
</div>
</div>
</div>
<p>The only difference in this class is the way the particles are positioned and adjusted in the tweens. To give you the illusion of depth/moving forward, I create a fake Z-axis value with the span of 0-1. 1 would be closest to the viewer and positioning the star at posX on the screen with the full scale of 1. Any other lower z-value brings the star towards the middle of the screen and also lowers the scale giving the illusion of the star moving further away from the viewer. Some fancy adjusting with alpha tweening in and out + a nice easeIn so the stars that is further away moves more slowly adds to the illusion even more.</p>
<p>Now, there is a great basic example how to use a few particles. Now is it a real system yet?? Well, there are a lot you could do to make it more dynamic. First of all we shouldn&#8217;t have to create 2 classes for these very similar classes. In the next part I ill give you the basics to create a more dynamic particle system where you can tweak a lot of parameters to be able to create snow, rain, fire, smoke, explosions etc&#8230; exciting, huh?<br />
Have fun!</p>
<p>/Andreas</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/labs/flash/particle-system-1-basic-particles.html/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>FaceWarp &#8211; mess up your face.</title>
		<link>http://www.x-com.se/labs/flash/facewarp-mess-up-your-face.html</link>
		<comments>http://www.x-com.se/labs/flash/facewarp-mess-up-your-face.html#comments</comments>
		<pubDate>Fri, 16 Apr 2010 12:59:09 +0000</pubDate>
		<dc:creator>Andreas</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.x-com.se/?p=979</guid>
		<description><![CDATA[So we&#8217;ve probably all seen it somehow. Upload an image ...]]></description>
			<content:encoded><![CDATA[<p>So we&#8217;ve probably all seen it somehow. Upload an image of yourself, transform it and then spread it around to your friends.</p>
<p>Here I tried one technique I came up with, using a polygonmesh (using Papervision3D but still keeping it plain without any Z-depth). Using this wired image I can easily string up every vertex in the mesh and move them around, controlling every and each muscle in the face if I want to. For this demo I have two controllers for the eyebrows and lips.<br />
To add some nice extra effect the sliders also control two bitmaplayers alpha. The bitmaps are just wrinkles and dark rings around the eye which is transformed via the UWV so it fits to every image you upload, just move the crosshairs to the center of the eyes and the corners of the mouth.</p>
<p>Enjoy.</p>
<p><a rel="shadowbox;width=380;height=400" href="/wp-content/uploads/2010/04/FaceWarp.swf"><img title="facewarp" src="/wp-content/uploads/2010/04/faceWarp.jpg" alt="Facewarp" width="600" height="340" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/labs/flash/facewarp-mess-up-your-face.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vissa fick Guldägg, vi fick diplom</title>
		<link>http://www.x-com.se/aktuellt/vissa-fick-guldagg-vi-fick-diplom.html</link>
		<comments>http://www.x-com.se/aktuellt/vissa-fick-guldagg-vi-fick-diplom.html#comments</comments>
		<pubDate>Fri, 16 Apr 2010 07:43:29 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Aktuellt]]></category>

		<guid isPermaLink="false">http://www.x-com.se/?p=972</guid>
		<description><![CDATA[Igår kväll delades årets Guldägg ut. Vårt hopp stod till ...]]></description>
			<content:encoded><![CDATA[<p><img src="/wp-content/uploads/2010/04/guldagg_300x200.jpg" alt="Guldägget" title="Guldägget" width="300" height="200" class="alignright size-full wp-image-636" />Igår kväll delades årets <a href="http://www.guldagget.se/">Guldägg</a> ut. Vårt hopp stod till kampanjen <a target="_self" href="http://www.x-com.se/produktioner#tele2-mobilt-internet-live">Mobilt Internet Live för Tele2</a> som vi producerade tillsammans med Forsman &#038; Bodenfors. Tyvärr blev det inget Guldägg för oss, men väl två diplom i kategorierna <a href="http://www.resume.se/nyheter/2010/04/15/riksgalden-bast-pa-integre/">integrerat</a> och <a href="http://www.resume.se//nyheter/2010/04/15/webbskrall-i-guldagget/">interaktivt</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/aktuellt/vissa-fick-guldagg-vi-fick-diplom.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gevalia &#8211; Whole Bean Messenger</title>
		<link>http://www.x-com.se/produktioner/kampanjer#gevalia-whole-bean-messenger</link>
		<comments>http://www.x-com.se/produktioner/kampanjer#gevalia-whole-bean-messenger#comments</comments>
		<pubDate>Wed, 07 Apr 2010 11:31:05 +0000</pubDate>
		<dc:creator>Jani</dc:creator>
				<category><![CDATA[Kampanjer]]></category>

		<guid isPermaLink="false">http://www.x-com.se/?p=950</guid>
		<description><![CDATA[Tillsammans med B-Reel som stått för designen, har vi skapat ...]]></description>
			<content:encoded><![CDATA[<p>Tillsammans med B-Reel som stått för designen, har vi skapat kampanjsajten för Gevalia &#8211; Whole Bean Messenger.</p>
<p>Följ kaffegurun Giovanni Masurzo i hans kaffeskola när han berättar hur du med enkla medel brygger det perfekta kaffet, eller skicka en rolig hälsning till dina vänner där du själv spelar huvudrollen.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/kampanjer#gevalia-whole-bean-messenger/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disney &#8211; När klockan ringer</title>
		<link>http://www.x-com.se/produktioner/webbplatser#disney-nar-klockan-ringer</link>
		<comments>http://www.x-com.se/produktioner/webbplatser#disney-nar-klockan-ringer#comments</comments>
		<pubDate>Wed, 24 Feb 2010 23:00:56 +0000</pubDate>
		<dc:creator>Jani</dc:creator>
				<category><![CDATA[Webbplatser]]></category>

		<guid isPermaLink="false">http://www.x-com.se/?p=929</guid>
		<description><![CDATA[Vi har fått äran att tillsammans med Pool skapa en ...]]></description>
			<content:encoded><![CDATA[<p>Vi har fått äran att tillsammans med Pool skapa en interaktiv hemsida till Disney Channel Scandinavias första lokalproducerade program &#8220;När klockan ringer&#8221;.</p>
<p>Denna barnserie handlar om vad som händer under de 5 minuterna i korridoren mellan lektionerna. Varje avsnitt inleds och avslutas med att skolklockan ringer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/webbplatser#disney-nar-klockan-ringer/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ving &#8211; Turkiet</title>
		<link>http://www.x-com.se/produktioner/kampanjer#ving-turkiet</link>
		<comments>http://www.x-com.se/produktioner/kampanjer#ving-turkiet#comments</comments>
		<pubDate>Wed, 17 Feb 2010 10:12:24 +0000</pubDate>
		<dc:creator>Jani</dc:creator>
				<category><![CDATA[Kampanjer]]></category>

		<guid isPermaLink="false">http://www.x-com.se/?p=936</guid>
		<description><![CDATA[Tillsammans med Forsman &#038; Bodenfors har vi skapat en kampanj ...]]></description>
			<content:encoded><![CDATA[<p>Tillsammans med Forsman &#038; Bodenfors har vi skapat en kampanj för Ving. I detta fall är det resmålet Turkiet, och kanske framförallt deras matkultur, som uppmärksammas.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/kampanjer#ving-turkiet/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SVT &#8211; OS, live i mobilen</title>
		<link>http://www.x-com.se/produktioner/kampanjer#svt-os-live-i-mobilen</link>
		<comments>http://www.x-com.se/produktioner/kampanjer#svt-os-live-i-mobilen#comments</comments>
		<pubDate>Mon, 15 Feb 2010 13:57:18 +0000</pubDate>
		<dc:creator>Jani</dc:creator>
				<category><![CDATA[Kampanjer]]></category>

		<guid isPermaLink="false">http://www.x-com.se/?p=927</guid>
		<description><![CDATA[Olympiska vinterspelen 2010 avgörs i Vancouver. Startskottet gick den 12:e ...]]></description>
			<content:encoded><![CDATA[<p>Olympiska vinterspelen 2010 avgörs i Vancouver. Startskottet gick den 12:e februari, likaså deadline för våra banners som vi producerat för Forsman &#038; Bodenfors.</p>
<p>Syftet med dessa banners är att uppmärksamma att OS går att följa direkt i mobilen.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/kampanjer#svt-os-live-i-mobilen/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vinnare av Årets företagare 2010!</title>
		<link>http://www.x-com.se/aktuellt/vinnare-av-arets-foretagare-2010.html</link>
		<comments>http://www.x-com.se/aktuellt/vinnare-av-arets-foretagare-2010.html#comments</comments>
		<pubDate>Mon, 15 Feb 2010 10:45:14 +0000</pubDate>
		<dc:creator>Jani</dc:creator>
				<category><![CDATA[Aktuellt]]></category>

		<guid isPermaLink="false">http://www.x-com.se/?p=906</guid>
		<description><![CDATA[Vi var nominerade till Årets företagare 2010 under tillställningen Marknadsplats ...]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.x-com.se/wp-content/uploads/2010/02/x-com_vinnare_marknadsplats.jpg" alt="Marknadsplats 2010" title="Marknadsplats 2010" width="300" height="200" class="alignright size-full wp-image-907" />Vi var nominerade till Årets företagare 2010 under tillställningen Marknadsplats som hölls i Stadshuset. Vi på X-Com gick segrande och firade hela natten lång! Vi tackar för en lyckad tillställning.</p>
<p>Läs mer på <a href="http://ekuriren.se/jobbpengar/1.629606">Eskilstuna Kuriren</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/aktuellt/vinnare-av-arets-foretagare-2010.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mer &#8211; Valentines day</title>
		<link>http://www.x-com.se/produktioner/kampanjer#mer-valentines-day</link>
		<comments>http://www.x-com.se/produktioner/kampanjer#mer-valentines-day#comments</comments>
		<pubDate>Thu, 04 Feb 2010 12:29:26 +0000</pubDate>
		<dc:creator>Jani</dc:creator>
				<category><![CDATA[Kampanjer]]></category>

		<guid isPermaLink="false">http://www.x-com.se/?p=886</guid>
		<description><![CDATA[Denna kampanj för MER, i samband med alla hjärtans dag ...]]></description>
			<content:encoded><![CDATA[<p>Denna kampanj för MER, i samband med alla hjärtans dag, har vi både designat och utvecklat på uppdrag av Wyatt. Kampanjen ligger på Bilddagboken och går ut på att användarna tar ett pussfoto med webbkameran och skickar dessa pussar till sina vänner. Om den skickade pussen blir besvarad har paret en chans att vinna biljetter till den bioaktuella filmen Valentine&#8217;s Day.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/kampanjer#mer-valentines-day/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Firebird &#8211; a sound visualization</title>
		<link>http://www.x-com.se/labs/flash/firebird-a-sound-visualization.html</link>
		<comments>http://www.x-com.se/labs/flash/firebird-a-sound-visualization.html#comments</comments>
		<pubDate>Fri, 22 Jan 2010 10:12:18 +0000</pubDate>
		<dc:creator>Andreas</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[firebird]]></category>
		<category><![CDATA[gabriel]]></category>
		<category><![CDATA[peter]]></category>
		<category><![CDATA[sound]]></category>
		<category><![CDATA[spectrum]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=715</guid>
		<description><![CDATA[The other day I stumbled upon a minimalistic music video ...]]></description>
			<content:encoded><![CDATA[<p>The other day I stumbled upon a minimalistic music video by Peter Gabriel called <a title="Der Rhythmus der Hitze" href="http://www.youtube.com/v/wv4_g5pmFPQ" rel="shadowbox[post-715];player=swf;width=640;height=385;">Der Rhythmus der Hitze</a>. As I&#8217;ve never had the chance to experiment with the Spectrum-functionality in AS3 I thought this would be a perfect first example as I found the birdlike visuals were quite nice and mesmerizing. Here&#8217;s the result.</p>
<p><a rel="shadowbox;width=700;height=550" href="/wp-content/uploads/2010/01/Firebird.swf"><img title="Firebird" src="/wp-content/uploads/2010/01/firebird_preview.jpg" alt="Firebird" width="600" height="340" /></a></p>
<p><span id="more-715"></span></p>
<div class="codesnip-container-wrapper">
<div class="codesnip-container-innerwrapper">
<div class="codesnip-container" >
<div class="actionscript codesnip" style="font-family:monospace;">package<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">display</span>.<span class="me1">GradientType</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">display</span>.<span class="me1">Sprite</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">events</span>.<span class="me1">Event</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">filters</span>.<span class="me1">GlowFilter</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">geom</span>.<span class="me1">Matrix</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">media</span>.<span class="me1">SoundMixer</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">utils</span>.<span class="me1">ByteArray</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> se.<span class="me1">xcom</span>.<span class="kw3">math</span>.<span class="me1">DegreesVector</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">class</span> Firebird <span class="kw3">extends</span> Sprite<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> const BAR_WIDTH:<span class="kw3">int</span> = <span class="nu0">1</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> ba:ByteArray;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> matrix:Matrix;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> degrees:DegreesVector;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> counter:<span class="kw3">int</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> aColours:<span class="kw3">Array</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> Firebird<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">super</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; counter = <span class="nu0">0</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aColours = <span class="br0">&#91;</span>0xFFFFFF,0xFFFF33,0xFF2200,0xFF0000<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ba = <span class="kw2">new</span> ByteArray<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; matrix = <span class="kw2">new</span> Matrix<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; degrees = <span class="kw2">new</span> DegreesVector<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">this</span>.<span class="me1">filters</span> = <span class="br0">&#91;</span><span class="kw2">new</span> GlowFilter<span class="br0">&#40;</span>0xFF2211,1,20,30,3,2<span class="br0">&#41;</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">this</span>.<span class="me1">addEventListener</span><span class="br0">&#40;</span>Event.<span class="me1">ENTER_FRAME</span>,onFrameTick<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">function</span> onFrameTick<span class="br0">&#40;</span><span class="kw3">e</span>:Event<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> enhance:<span class="kw3">Number</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> barHeight:<span class="kw3">Number</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> posY:<span class="kw3">Number</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// get new ByteArray from soundmixer</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SoundMixer.<span class="me1">computeSpectrum</span><span class="br0">&#40;</span>ba,<span class="kw2">true</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// setting up gradientcolours. Using the aColours gives us the flexibility</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// &nbsp;to switch between different colours in the future if we would like to. </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> gradientColours:<span class="kw3">Array</span> = <span class="br0">&#91;</span>aColours<span class="br0">&#91;</span>3<span class="br0">&#93;</span>, aColours<span class="br0">&#91;</span>2<span class="br0">&#93;</span>, aColours<span class="br0">&#91;</span>1<span class="br0">&#93;</span>, aColours<span class="br0">&#91;</span>0<span class="br0">&#93;</span>, aColours<span class="br0">&#91;</span>1<span class="br0">&#93;</span>, aColours<span class="br0">&#91;</span>2<span class="br0">&#93;</span>, aColours<span class="br0">&#91;</span>3<span class="br0">&#93;</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">with</span><span class="br0">&#40;</span>graphics<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span> &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">clear</span><span class="br0">&#40;</span><span class="br0">&#41;</span>; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw2">var</span> i:<span class="kw3">int</span>=<span class="nu0">0</span>; i<span class="sy0">&lt;</span><span class="nu0">256</span>; i+=BAR_WIDTH<span class="br0">&#41;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span> &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// enhance largen the shape towards the middle. The first 60 bars will be enhanced </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// (simply to create the birdhead)</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; enhance = 60-i;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; enhance = <span class="br0">&#40;</span>enhance <span class="sy0">&lt;</span>0<span class="br0">&#41;</span>?0:enhance;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// now the bar is moved in Y-axis using a normal sinus curve. (Using a faster custom Sine-class)</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; posY = degrees.<span class="me1">fastSin</span><span class="br0">&#40;</span><span class="kw3">int</span><span class="br0">&#40;</span>counter+i<span class="sy0">*</span>0.65<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">*</span><span class="nu0">160</span>;&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// bar height is calculated using the sound spectrum in the ByteArray. </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// It is multiplied and enhanced if close to the middle </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; barHeight = <span class="br0">&#40;</span>ba.<span class="me1">readFloat</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">*</span> <span class="br0">&#40;</span>100+enhance<span class="br0">&#41;</span><span class="br0">&#41;</span>; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// creating the gradientbox set up gradientfill.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; matrix.<span class="me1">createGradientBox</span><span class="br0">&#40;</span>BAR_WIDTH,2<span class="sy0">*</span>barHeight,1.57075,0,-barHeight-posY<span class="sy0">*</span>0.5<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">beginGradientFill</span><span class="br0">&#40;</span>GradientType.<span class="me1">LINEAR</span>,gradientColours,<span class="br0">&#91;</span>0,1,1,1,1,1,0<span class="br0">&#93;</span>,<span class="br0">&#91;</span>0,50,110,128,146,205,255<span class="br0">&#93;</span>,matrix<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Draing 2 bars. One for each wing. Adding BAR_WIDTH on the left to avoid a gap in the middle.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; drawRect<span class="br0">&#40;</span>i, -barHeight-posY<span class="sy0">*</span>0.5, BAR_WIDTH, 2<span class="sy0">*</span>barHeight<span class="br0">&#41;</span>; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; drawRect<span class="br0">&#40;</span>-i+BAR_WIDTH, -barHeight-posY<span class="sy0">*</span>0.5, BAR_WIDTH, 2<span class="sy0">*</span>barHeight<span class="br0">&#41;</span>; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// adding counter so the Sine-curve starts one step away next frame (result: the wave motion)</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; counter+=<span class="nu0">1</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
</div>
</div>
</div>
<p>The code is quite straight forward.<br />
Every single frame the SoundMixer creates a ByteArray containing Numbers from 0 &#8211; 1 which is used in order to create the bars/lines. The only thing that is custom is the DegreeVector class that converts all Radian to Degrees (as I&#8217;m no fan of radians). What it also does is to use a precalculated array of Sine-values that speedens up the sine-calculations a bit. This is of course not necessary and you could easily use the normal Math.sin functions to get the same result.</p>
<p>Just build a Firebird object in your main class, add it to stage and start playing any sound and Phoenix will manifest itself.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/labs/flash/firebird-a-sound-visualization.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Vi är nominerade till Årets Företag 2010 i Eskilstuna</title>
		<link>http://www.x-com.se/aktuellt/vi-ar-nominerade-till-arets-foretag-2009-i-eskilstuna.html</link>
		<comments>http://www.x-com.se/aktuellt/vi-ar-nominerade-till-arets-foretag-2009-i-eskilstuna.html#comments</comments>
		<pubDate>Tue, 12 Jan 2010 11:03:37 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Aktuellt]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=635</guid>
		<description><![CDATA[Vi bockar och bugar för nomineringen till Årets Företag 2010 ...]]></description>
			<content:encoded><![CDATA[<p><img src="http://devx.x-com.se/wp-content/uploads/2010/01/marknadsplats_300x200.jpg" alt="Marknadsplats 2010" title="Marknadsplats 2010" width="300" height="200" class="alignright size-full wp-image-636" />Vi bockar och bugar för nomineringen till Årets Företag 2010 i Eskilstuna. Det är Nyföretagarcentrum, Företagarna och Marknadsföreningen som varje år anordnar Marknadsplats där även Årets Nyföretagare och Årets Marknadsförare utses. Vinnarna utses den 11 februari i Stadshuset så håll tummarna till dess.</p>
<p><a href="http://www.marknadsplats.nu">http://www.marknadsplats.nu</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/aktuellt/vi-ar-nominerade-till-arets-foretag-2009-i-eskilstuna.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Archus Arkitekter &#8211; Webbplats</title>
		<link>http://www.x-com.se/produktioner/webbplatser#archus-arkitekter-webbplats</link>
		<comments>http://www.x-com.se/produktioner/webbplatser#archus-arkitekter-webbplats#comments</comments>
		<pubDate>Fri, 08 Jan 2010 16:37:14 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Webbplatser]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Flash AS3]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Umbraco]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=608</guid>
		<description><![CDATA[Vi har tagit fram en ny webbplats åt västeråsföretaget Archus ...]]></description>
			<content:encoded><![CDATA[<p>Vi har tagit fram en ny webbplats åt västeråsföretaget Archus Arkitekter. De själva har gjort det mesta av designarbetet och vi har gjort det tekniska. Sajten bygger på Open Source CMS:et <a href="http://www.umbraco.org">Umbraco</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/webbplatser#archus-arkitekter-webbplats/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>God Jul &amp; Gott Nytt År!</title>
		<link>http://www.x-com.se/aktuellt/god-jul-gott-nytt-ar.html</link>
		<comments>http://www.x-com.se/aktuellt/god-jul-gott-nytt-ar.html#comments</comments>
		<pubDate>Tue, 15 Dec 2009 08:30:02 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Aktuellt]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=543</guid>
		<description><![CDATA[I år har vi valt att skänka en slant till ...]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" title="Cancerfondens Julgåva 2009" src="/wp-content/uploads/2010/01/cancerfonden2009.jpg" alt="Cancerfondens Julgåva 2009" width="300" height="200" />I år har vi valt att skänka en slant till Cancerfonden istället för att bjuda våra kunder och samarbetspartners på ett julspel som vi har gjort tidigare år. Cancer är en hemsk sjukdom som allt fler drabbas av. Vår slant kanske kan hjälpa en liten bit på väg till botemedlet.</p>
<p><a href="http://www.cancerfonden.se">Skänk en slant du också!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/aktuellt/god-jul-gott-nytt-ar.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Acne Production &#8211; Webbplats</title>
		<link>http://www.x-com.se/produktioner/webbplatser#acne-production-webbplats</link>
		<comments>http://www.x-com.se/produktioner/webbplatser#acne-production-webbplats#comments</comments>
		<pubDate>Mon, 14 Dec 2009 19:18:34 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Webbplatser]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=623</guid>
		<description><![CDATA[Våra vänner på Acne Digital och Acne Film har gått ...]]></description>
			<content:encoded><![CDATA[<p>Våra vänner på Acne Digital och Acne Film har gått samman och bildat Acne Production. Vi hjälpte dem med att programmera den nya webbplatsen. De själva har gjort designen.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/webbplatser#acne-production-webbplats/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Brämhults &#8211; Sajten med kort hållbarhet!</title>
		<link>http://www.x-com.se/produktioner/webbplatser#bramhults-sajten-med-kort-hallbarhet</link>
		<comments>http://www.x-com.se/produktioner/webbplatser#bramhults-sajten-med-kort-hallbarhet#comments</comments>
		<pubDate>Wed, 09 Dec 2009 14:38:40 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Webbplatser]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Flash AS3]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Umbraco]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=460</guid>
		<description><![CDATA[Tillsammans med reklambyrån Volontaire har vi utvecklat en ny webbplats ...]]></description>
			<content:encoded><![CDATA[<p>Tillsammans med reklambyrån Volontaire har vi utvecklat en ny webbplats åt juiceföretaget Brämhults. Deras färskpressade juicer har en hållbarhet på 18 dagar och det gäller även webbplatsen. Var 18:e dag förnyas den med ett nytt tema. Vi har utvecklat ett flexibelt system där kunden med relativt enkla grepp kan göra stora förändringar på sajten. Lösningen bygger på Open Source CMS:et Umbraco.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/webbplatser#bramhults-sajten-med-kort-hallbarhet/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ännu fler priser!</title>
		<link>http://www.x-com.se/aktuellt/annu-fler-priser.html</link>
		<comments>http://www.x-com.se/aktuellt/annu-fler-priser.html#comments</comments>
		<pubDate>Thu, 03 Dec 2009 13:58:53 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Aktuellt]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=371</guid>
		<description><![CDATA[I helgen avgjordes reklamtävlingen Epica Awards 2009 och våra produktioner ...]]></description>
			<content:encoded><![CDATA[<p><img src="/wp-content/uploads/2009/12/aktuellt_epica-300x200.jpg" alt="Epica Awards" title="Epica Awards" width="300" height="200" class="alignright" />I helgen avgjordes reklamtävlingen Epica Awards 2009 och våra produktioner för Ikea &#8211; Swedens Sleepiest Contest (F&#038;B/B-Reel) och Tele2 &#8211; Mobilt Internet Live (F&#038;B) vann priser. Silver till Ikea och brons till Tele2. Grattis till oss och alla andra medverkande!</p>
<p>Läs mer på <a href="http://www.epica-awards.com/pages/results/2009/agency01029.html">Epica-Awards.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/aktuellt/annu-fler-priser.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Leine &amp; Linde &#8211; Produktpresentation</title>
		<link>http://www.x-com.se/produktioner/kampanjer#leine-linde-produktpresentation</link>
		<comments>http://www.x-com.se/produktioner/kampanjer#leine-linde-produktpresentation#comments</comments>
		<pubDate>Mon, 30 Nov 2009 21:00:59 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Kampanjer]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=140</guid>
		<description><![CDATA[Tillsammans med strängnäsföretaget Furillo, som står för designen, har vi ...]]></description>
			<content:encoded><![CDATA[<p>Tillsammans med strängnäsföretaget Furillo, som står för designen, har vi skapat en interaktiv presentation till Leine &#038; Lindes nya pulsgivare. Denna interaktiva presentation, översatt till flera olika språk, är tänkt att köras på pekskärm på olika mässor runt om i världen.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/kampanjer#leine-linde-produktpresentation/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vi har vunnit pris!</title>
		<link>http://www.x-com.se/aktuellt/vi-har-vunnit-pris.html</link>
		<comments>http://www.x-com.se/aktuellt/vi-har-vunnit-pris.html#comments</comments>
		<pubDate>Mon, 30 Nov 2009 14:33:15 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Aktuellt]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=387</guid>
		<description><![CDATA[I helgen avgjordes Eurobest 2009 &#8211; The European Advertising Festival ...]]></description>
			<content:encoded><![CDATA[<p><img src="http://devx.x-com.se/wp-content/uploads/2009/11/aktuellt_eurobest_300_200.jpg" alt="Eurobest" title="Eurobest" width="300" height="200" class="alignright" />I helgen avgjordes Eurobest 2009 &#8211; The European Advertising Festival i Amsterdam. Våra produktioner för Ikea &#8211; Swedens Sleepiest Contest (F&#038;B/B-Reel) och Tele2 &#8211; Mobile Internet Live (F&#038;B) fanns med på shortlisten. Det blev tillslut ett silver för Tele2. Kul och grattis till alla medverkande!</p>
<p>Läs mer på <a href="http://www.eurobest.com/winners/2009/interactive/index.cfm?award=3">Eurobest.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/aktuellt/vi-har-vunnit-pris.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Välkommen Jesper!</title>
		<link>http://www.x-com.se/aktuellt/valkommen-jesper.html</link>
		<comments>http://www.x-com.se/aktuellt/valkommen-jesper.html#comments</comments>
		<pubDate>Tue, 03 Nov 2009 08:35:53 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Aktuellt]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=571</guid>
		<description><![CDATA[Vi är mycket glada över att lyckats locka hit Jesper ...]]></description>
			<content:encoded><![CDATA[<p><img src="/wp-content/uploads/2010/01/jesper.jpg" alt="Jesper Jonsson" title="Jesper Jonsson" width="300" height="200" class="alignright" />Vi är mycket glada över att lyckats locka hit Jesper Jonsson. Han kommer närmast från det egna företaget Morning Lemon där han bland annat har jobbat med iPhone applikationer och webbprogrammering. Han kommer främst hjälpa oss med webbprogrammering och systemutveckling. Välkommen!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/aktuellt/valkommen-jesper.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vi samarbetar med två av världens sju bästa byråer!</title>
		<link>http://www.x-com.se/aktuellt/vi-samarbetar-med-tva-av-varldens-sju-basta-byraer.html</link>
		<comments>http://www.x-com.se/aktuellt/vi-samarbetar-med-tva-av-varldens-sju-basta-byraer.html#comments</comments>
		<pubDate>Sun, 01 Nov 2009 10:05:31 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Aktuellt]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=51</guid>
		<description><![CDATA[Amerikanska Creativity-Online rankar våra kompisar på ACNE Production och B-Reel ...]]></description>
			<content:encoded><![CDATA[<p>Amerikanska Creativity-Online rankar våra kompisar på ACNE Production och B-Reel som två av världens sju bästa byråer. Med på listan finns även ytterligare två svenska företag, Perfect Fools och North Kingdom, så Sverige dominerar rejält i den digitala branschen.</p>
<p>Läs mer på <a href="http://www.resume.se/nyheter/2009/10/28/sverige-bast-pa-digitalt/index.xml">Resume.se</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/aktuellt/vi-samarbetar-med-tva-av-varldens-sju-basta-byraer.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tele2 &#8211; Mobilt Internet Live</title>
		<link>http://www.x-com.se/produktioner/kampanjer#tele2-mobilt-internet-live</link>
		<comments>http://www.x-com.se/produktioner/kampanjer#tele2-mobilt-internet-live#comments</comments>
		<pubDate>Mon, 12 Oct 2009 12:02:11 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Kampanjer]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=68</guid>
		<description><![CDATA[Tillsammans med Forsman &#038; Bodenfors har vi tagit fram en ...]]></description>
			<content:encoded><![CDATA[<p>Tillsammans med Forsman &#038; Bodenfors har vi tagit fram en kampanj för Tele2 Mobilt Internet &#8211; Årets jobbigaste test. Reportern Olle Garp livesänder 8 timmar om dagen, i en hel vecka, via mobilt internet.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/kampanjer#tele2-mobilt-internet-live/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ving &#8211; Thailand</title>
		<link>http://www.x-com.se/produktioner/kampanjer#ving-thailand</link>
		<comments>http://www.x-com.se/produktioner/kampanjer#ving-thailand#comments</comments>
		<pubDate>Tue, 25 Aug 2009 13:23:07 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Kampanjer]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=62</guid>
		<description><![CDATA[På uppdrag av reklambyrån Forsman &#038; Bodenfors har vi ...]]></description>
			<content:encoded><![CDATA[<p>På uppdrag av reklambyrån Forsman &#038; Bodenfors har vi gjort kampanjsajt och webbannonser för Vings senaste Thailand-kampanj.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/kampanjer#ving-thailand/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Välkommen Jani!</title>
		<link>http://www.x-com.se/aktuellt/valkommen-jani.html</link>
		<comments>http://www.x-com.se/aktuellt/valkommen-jani.html#comments</comments>
		<pubDate>Mon, 03 Aug 2009 09:00:52 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Aktuellt]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=579</guid>
		<description><![CDATA[Nu är vi fem anställda igen och vårat senaste tillskott ...]]></description>
			<content:encoded><![CDATA[<p><img src="/wp-content/uploads/2010/01/jani.jpg" alt="Jani Muikku" title="Jani Muikku" width="300" height="200" class="alignright" />Nu är vi fem anställda igen och vårat senaste tillskott heter Jani Muikku. Han kommer främst jobba med webbprogrammering och bygga webbplatser, men även en del design. Välkommen!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/aktuellt/valkommen-jani.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Boxer &#8211; Vinn en glass!</title>
		<link>http://www.x-com.se/produktioner/kampanjer#boxer-vinn-en-glass</link>
		<comments>http://www.x-com.se/produktioner/kampanjer#boxer-vinn-en-glass#comments</comments>
		<pubDate>Thu, 25 Jun 2009 13:21:31 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Kampanjer]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=86</guid>
		<description><![CDATA[Tillsammans med reklambyrån AbbyNorm och Stopp ...]]></description>
			<content:encoded><![CDATA[<p>Tillsammans med reklambyrån AbbyNorm och produktionsbolaget Stopp har vi gjort en frågesport där 50 vinnare varje dag får en glasscheck via SMS.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/kampanjer#boxer-vinn-en-glass/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IKEA &#8211; Sveriges Tröttaste Tävling</title>
		<link>http://www.x-com.se/produktioner/kampanjer#ikea-sveriges-trottaste-tavling</link>
		<comments>http://www.x-com.se/produktioner/kampanjer#ikea-sveriges-trottaste-tavling#comments</comments>
		<pubDate>Wed, 24 Jun 2009 14:00:53 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Kampanjer]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=27</guid>
		<description><![CDATA[Tillsammans med Ikeas reklambyrå Forsman &#038; Bodenfors och produktionsbolaget B-Reel ...]]></description>
			<content:encoded><![CDATA[<p>Tillsammans med Ikeas reklambyrå Forsman &#038; Bodenfors och produktionsbolaget B-Reel har vi tagit fram webbplats och webbannonser till lanseringen av nya sängsortimentet Sultan.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/kampanjer#ikea-sveriges-trottaste-tavling/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Transavia &#8211; Wake up call</title>
		<link>http://www.x-com.se/produktioner/kampanjer#transavia-wake-up-call</link>
		<comments>http://www.x-com.se/produktioner/kampanjer#transavia-wake-up-call#comments</comments>
		<pubDate>Tue, 09 Jun 2009 14:11:31 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Kampanjer]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=106</guid>
		<description><![CDATA[Tillsammans med reklambyrån AD&#038;D har vi producerat en ...]]></description>
			<content:encoded><![CDATA[<p>Tillsammans med reklambyrån AD&#038;D har vi producerat en kampanj för det holländska flygbolaget Transavia.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/kampanjer#transavia-wake-up-call/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CoCo form &#8211; Webbplats</title>
		<link>http://www.x-com.se/produktioner/webbplatser#coco-form-webbplats</link>
		<comments>http://www.x-com.se/produktioner/webbplatser#coco-form-webbplats#comments</comments>
		<pubDate>Tue, 09 Jun 2009 07:00:17 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Webbplatser]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=118</guid>
		<description><![CDATA[Vi har tagit fram en ny webbplats åt våra vänner på CoCo form ...]]></description>
			<content:encoded><![CDATA[<p>Vi har tagit fram en ny webbplats åt våra vänner på CoCo form.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/webbplatser#coco-form-webbplats/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mälarvåningar &#8211; Webbplats</title>
		<link>http://www.x-com.se/produktioner/webbplatser#malarvaningar-webbplats</link>
		<comments>http://www.x-com.se/produktioner/webbplatser#malarvaningar-webbplats#comments</comments>
		<pubDate>Tue, 09 Jun 2009 06:08:52 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Webbplatser]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=126</guid>
		<description><![CDATA[Tillsammans med reklambyrån Järv har vi tagit fram en ny ...]]></description>
			<content:encoded><![CDATA[<p>Tillsammans med reklambyrån Järv har vi tagit fram en ny webbplats åt Mälarvåningar.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/webbplatser#malarvaningar-webbplats/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BoEL &#8211; Elförbrukning</title>
		<link>http://www.x-com.se/produktioner/ovrigt#boel-elforbrukning</link>
		<comments>http://www.x-com.se/produktioner/ovrigt#boel-elforbrukning#comments</comments>
		<pubDate>Thu, 21 May 2009 14:15:20 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Övrigt]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=706</guid>
		<description><![CDATA[Interactive Institute har anlitat oss för att bygga en applikation ...]]></description>
			<content:encoded><![CDATA[<p>Interactive Institute har anlitat oss för att bygga en applikation som grafiskt visar elförbrukningen i ett antal utvalda hushåll. Experimentet går ut på att testa om hushållens elförbrukning minskar om de kan enkelt kan se sin egen och grannarnas förbrukning.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/ovrigt#boel-elforbrukning/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Välkommen Patrik!</title>
		<link>http://www.x-com.se/aktuellt/valkommen-patrik.html</link>
		<comments>http://www.x-com.se/aktuellt/valkommen-patrik.html#comments</comments>
		<pubDate>Thu, 12 Mar 2009 09:02:15 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Aktuellt]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=582</guid>
		<description><![CDATA[Från och med 9 mars jobbar Patrik Adolfsson hos oss. ...]]></description>
			<content:encoded><![CDATA[<p><img src="/wp-content/uploads/2010/01/patrik.jpg" alt="Patrik" title="Patrik" width="300" height="200" class="alignright" />Från och med 9 mars jobbar Patrik Adolfsson hos oss. Han kommer främst jobba med webb- och systemutveckling, men även projektledning. Han har ca 10 års erfarenhet från branschen och har jobbat med bland annat ving.se och nu senast Scanias IT-avdelning.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/aktuellt/valkommen-patrik.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SVT Play</title>
		<link>http://www.x-com.se/produktioner/kampanjer#svt-play</link>
		<comments>http://www.x-com.se/produktioner/kampanjer#svt-play#comments</comments>
		<pubDate>Mon, 23 Feb 2009 15:47:26 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Kampanjer]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=133</guid>
		<description><![CDATA[På uppdrag av F&#038;B har vi gjort annonser för lanseringen ...]]></description>
			<content:encoded><![CDATA[<p>På uppdrag av F&#038;B har vi gjort annonser för lanseringen av SVT:s nya webb-tv SVT Play.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/kampanjer#svt-play/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Red Collar Project</title>
		<link>http://www.x-com.se/produktioner/webbplatser#red-collar-project</link>
		<comments>http://www.x-com.se/produktioner/webbplatser#red-collar-project#comments</comments>
		<pubDate>Mon, 16 Feb 2009 09:41:01 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Webbplatser]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=148</guid>
		<description><![CDATA[På uppdrag av MnO International har vi tagit fram en ...]]></description>
			<content:encoded><![CDATA[<p>På uppdrag av MnO International har vi tagit fram en ny webbplats för klädmärket Red Collar Project.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/webbplatser#red-collar-project/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LG &#8211; Chatt Up</title>
		<link>http://www.x-com.se/produktioner/spel#lg-chatt-up</link>
		<comments>http://www.x-com.se/produktioner/spel#lg-chatt-up#comments</comments>
		<pubDate>Mon, 16 Feb 2009 09:02:00 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Spel]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=153</guid>
		<description><![CDATA[Tillsammans med Wyatt Creative har vi gjort ett chattspel åt ...]]></description>
			<content:encoded><![CDATA[<p>Tillsammans med Wyatt Creative har vi gjort ett chattspel åt LG i samband med att deras nya telefon LG KS360 lanserades. Spelet integrerades i bilddagboken.se.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/spel#lg-chatt-up/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ving &#8211; Aruba</title>
		<link>http://www.x-com.se/produktioner/kampanjer#ving-aruba</link>
		<comments>http://www.x-com.se/produktioner/kampanjer#ving-aruba#comments</comments>
		<pubDate>Mon, 16 Feb 2009 07:09:03 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Kampanjer]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=161</guid>
		<description><![CDATA[På uppdrag av Forsman &#038; Bodenfors har vi producerat ...]]></description>
			<content:encoded><![CDATA[<p>På uppdrag av Forsman &#038; Bodenfors har vi producerat kampanjsajt för resmålet Aruba.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/kampanjer#ving-aruba/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eskilstuna 350 år &#8211; Webbplats</title>
		<link>http://www.x-com.se/produktioner/webbplatser#eskilstuna-350-ar-webbplats</link>
		<comments>http://www.x-com.se/produktioner/webbplatser#eskilstuna-350-ar-webbplats#comments</comments>
		<pubDate>Sun, 15 Feb 2009 15:16:54 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Webbplatser]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=171</guid>
		<description><![CDATA[Tillsammans med reklambyrån Järv har vi tagit fram ...]]></description>
			<content:encoded><![CDATA[<p>Tillsammans med reklambyrån Järv har vi tagit fram en webbplats för Eskilstunas 350 års jubileum.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/webbplatser#eskilstuna-350-ar-webbplats/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Säljtävling &#8211; Guldrushen 2009</title>
		<link>http://www.x-com.se/produktioner/spel#saljtavling-guldrushen-2009</link>
		<comments>http://www.x-com.se/produktioner/spel#saljtavling-guldrushen-2009#comments</comments>
		<pubDate>Sun, 25 Jan 2009 13:19:51 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Spel]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=785</guid>
		<description><![CDATA[Länsförsäkringar Bergslagen har varje år en intern säljtävling. Personalen kan ...]]></description>
			<content:encoded><![CDATA[<p>Länsförsäkringar Bergslagen har varje år en intern säljtävling. Personalen kan på ett grafiskt sätt se hur de ligger till i tävlingen och sporras till att sälja mer för att uppnå uppsatta mål.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/spel#saljtavling-guldrushen-2009/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Radio Sörmland P4</title>
		<link>http://www.x-com.se/produktioner/ovrigt#radio-sormland-p4</link>
		<comments>http://www.x-com.se/produktioner/ovrigt#radio-sormland-p4#comments</comments>
		<pubDate>Fri, 05 Dec 2008 12:33:22 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Övrigt]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=177</guid>
		<description><![CDATA[Radio Sörmland har anlitat X-Com för en föreläsning ...]]></description>
			<content:encoded><![CDATA[<p>Radio Sörmland har anlitat X-Com för en föreläsning och workshopserie på temat webbinspiration. Tanken och förhoppningen är att de ska få upp ögonen för webben och lära sig utnyttja dess möjligheter och fördelar i den dagliga verksamheten.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/ovrigt#radio-sormland-p4/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tenzing &#8211; Webbplats</title>
		<link>http://www.x-com.se/produktioner/webbplatser#tenzing-webbplats</link>
		<comments>http://www.x-com.se/produktioner/webbplatser#tenzing-webbplats#comments</comments>
		<pubDate>Fri, 05 Dec 2008 09:11:42 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Webbplatser]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=195</guid>
		<description><![CDATA[Tillsammans med webbyrån Deasign har vi tagit fram en ny ...]]></description>
			<content:encoded><![CDATA[<p>Tillsammans med webbyrån Deasign har vi tagit fram en ny webbplats åt Tenzing AB.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/webbplatser#tenzing-webbplats/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Westermo &#8211; MDR Release</title>
		<link>http://www.x-com.se/produktioner/kampanjer#westermo-mdr-release</link>
		<comments>http://www.x-com.se/produktioner/kampanjer#westermo-mdr-release#comments</comments>
		<pubDate>Fri, 05 Dec 2008 08:38:28 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Kampanjer]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=201</guid>
		<description><![CDATA[När Westermo Teleindustri lanserade en ny 3G-router ...]]></description>
			<content:encoded><![CDATA[<p>När Westermo Teleindustri lanserade en ny 3G-router stod vi för webbannonserna.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/kampanjer#westermo-mdr-release/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wasa Sandwich</title>
		<link>http://www.x-com.se/produktioner/spel#wasa-sandwich</link>
		<comments>http://www.x-com.se/produktioner/spel#wasa-sandwich#comments</comments>
		<pubDate>Thu, 30 Oct 2008 14:13:42 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Spel]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=208</guid>
		<description><![CDATA[Tillsammans med Wyatt Creative har vi gjort ett spel för ...]]></description>
			<content:encoded><![CDATA[<p>Tillsammans med Wyatt Creative har vi gjort ett spel för Wasa Sandwich nya smak Skogens Skatt. Vinnaren blir kändis för en dag med egen annons på bilddagboken.se.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/spel#wasa-sandwich/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sälj mer &#8211; Webbplats</title>
		<link>http://www.x-com.se/produktioner/webbplatser#salj-mer-webbplats</link>
		<comments>http://www.x-com.se/produktioner/webbplatser#salj-mer-webbplats#comments</comments>
		<pubDate>Sat, 18 Oct 2008 20:23:03 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Webbplatser]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=676</guid>
		<description><![CDATA[Tillsammans med reklambyrån Järv har vi tagit fram en ny ...]]></description>
			<content:encoded><![CDATA[<p>Tillsammans med reklambyrån Järv har vi tagit fram en ny webbplats åt Pia Nilsson på Sälj mer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/webbplatser#salj-mer-webbplats/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Burridge Communication &#8211; Webbplats</title>
		<link>http://www.x-com.se/produktioner/webbplatser#burridge-communication-webbplats</link>
		<comments>http://www.x-com.se/produktioner/webbplatser#burridge-communication-webbplats#comments</comments>
		<pubDate>Sat, 18 Oct 2008 20:18:45 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Webbplatser]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=674</guid>
		<description><![CDATA[Tillsammans med reklambyrån Järv har vi tagit fram en ny ...]]></description>
			<content:encoded><![CDATA[<p>Tillsammans med reklambyrån Järv har vi tagit fram en ny webbplats åt Burridge Communication.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/webbplatser#burridge-communication-webbplats/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tele2 &#8211; Idol Quiz</title>
		<link>http://www.x-com.se/produktioner/spel#tele2-idol-quiz</link>
		<comments>http://www.x-com.se/produktioner/spel#tele2-idol-quiz#comments</comments>
		<pubDate>Wed, 15 Oct 2008 15:34:22 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Spel]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=227</guid>
		<description><![CDATA[Årets idolsäsong är igång för fullt och sponsras i år av bland annat Tele2 ...]]></description>
			<content:encoded><![CDATA[<p>Årets idolsäsong är igång för fullt och sponsras i år av bland annat Tele2. På uppdrag av I Branding har vi tagit fram en Idol Quiz där man kan testa sina idolkunskaper och vinna fina priser.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/spel#tele2-idol-quiz/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adidas &#8211; Stella McCartney</title>
		<link>http://www.x-com.se/produktioner/kampanjer#adidas-stella-mccartney</link>
		<comments>http://www.x-com.se/produktioner/kampanjer#adidas-stella-mccartney#comments</comments>
		<pubDate>Wed, 15 Oct 2008 09:02:47 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Kampanjer]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=233</guid>
		<description><![CDATA[I våras hjälpte vi Foreign med att bygga en sajt för Stella ...]]></description>
			<content:encoded><![CDATA[<p>I våras hjälpte vi Foreign med att bygga en sajt för Stella McCartneys vårkollektion. Nu är det höst och nu är sajten uppdaterad med höstkollektionen.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/kampanjer#adidas-stella-mccartney/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parken Zoo &#8211; Tyckotryckomaten</title>
		<link>http://www.x-com.se/produktioner/ovrigt#parken-zoo-tyckotryckomaten</link>
		<comments>http://www.x-com.se/produktioner/ovrigt#parken-zoo-tyckotryckomaten#comments</comments>
		<pubDate>Thu, 21 Aug 2008 13:52:28 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Övrigt]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=697</guid>
		<description><![CDATA[Vi och våra vänner på CoCo form har utvecklat en ...]]></description>
			<content:encoded><![CDATA[<p>Vi och våra vänner på CoCo form har utvecklat en &#8220;Tyckotryckomat&#8221; åt Parken Zoo. CoCo form skapade ett träd där vi byggde in en dator och en webbkamera. När besökaren tryckte på den stora blomman startades inspelningen och de kunde berätta om hur dagen på Parken Zoo hade varit.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/ovrigt#parken-zoo-tyckotryckomaten/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beckers &#8211; Målarskolan</title>
		<link>http://www.x-com.se/produktioner/kampanjer#beckers-malarskolan</link>
		<comments>http://www.x-com.se/produktioner/kampanjer#beckers-malarskolan#comments</comments>
		<pubDate>Tue, 13 May 2008 14:47:32 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Kampanjer]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=257</guid>
		<description><![CDATA[På uppdrag av Deasign har vi utvecklat en målarskola ...]]></description>
			<content:encoded><![CDATA[<p>Ursprungligen på uppdrag av Foreign har vi gjort en målarskola för Beckers. Vidareutvecklingen har skett tillsammans med Deasign.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/kampanjer#beckers-malarskolan/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Volvo &#8211; Miljö</title>
		<link>http://www.x-com.se/produktioner/kampanjer#volvo-miljo</link>
		<comments>http://www.x-com.se/produktioner/kampanjer#volvo-miljo#comments</comments>
		<pubDate>Tue, 13 May 2008 09:46:47 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Kampanjer]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=265</guid>
		<description><![CDATA[På uppdrag av Forsman &#038; Bodenfors har vi gjort annonser ...]]></description>
			<content:encoded><![CDATA[<p>På uppdrag av Forsman &#038; Bodenfors har vi gjort annonser för Volvos kampanj för deras miljöarbete.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/kampanjer#volvo-miljo/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tele2 &#8211; OS Quiz</title>
		<link>http://www.x-com.se/produktioner/spel#tele2-os-quiz</link>
		<comments>http://www.x-com.se/produktioner/spel#tele2-os-quiz#comments</comments>
		<pubDate>Thu, 17 Apr 2008 13:06:40 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Spel]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=323</guid>
		<description><![CDATA[Tele2 är teamsponsor till den Svenska OS-truppen ...]]></description>
			<content:encoded><![CDATA[<p>Tele2 är teamsponsor till den Svenska OS-truppen som i sommar åker till sommar-OS i Peking. För att uppmärksamma det får alla Tele2:s kunder vara med och tävla om en resa till Peking.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/spel#tele2-os-quiz/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Restaurang P-2 &#8211; Webbplats</title>
		<link>http://www.x-com.se/produktioner/webbplatser#restaurang-p-2-webbplats</link>
		<comments>http://www.x-com.se/produktioner/webbplatser#restaurang-p-2-webbplats#comments</comments>
		<pubDate>Thu, 17 Apr 2008 08:33:50 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Webbplatser]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=356</guid>
		<description><![CDATA[Tillsammans med reklambyrån Järv har vi tagit fram en ny ...]]></description>
			<content:encoded><![CDATA[<p>Tillsammans med reklambyrån Järv har vi tagit fram en ny webbplats åt våra grannar P-2. Vi valde en lösning där vi kunde lyfta fram de fina bilder som fotograf Joakim Serrander tagit på den nyrenoverade lokalen.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/webbplatser#restaurang-p-2-webbplats/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Volvo C30 &#8211; Mönster</title>
		<link>http://www.x-com.se/produktioner/kampanjer#volvo-c30-monster</link>
		<comments>http://www.x-com.se/produktioner/kampanjer#volvo-c30-monster#comments</comments>
		<pubDate>Fri, 04 Apr 2008 15:06:30 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Kampanjer]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=595</guid>
		<description><![CDATA[På uppdrag av reklambyrån Forsman &#038; Bodenfors har vi gjort ...]]></description>
			<content:encoded><![CDATA[<p>På uppdrag av reklambyrån Forsman &#038; Bodenfors har vi gjort webbannonser till lanseringen av nya Volvo C30 med mönster.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/kampanjer#volvo-c30-monster/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mälarbåten &#8211; Webbplats</title>
		<link>http://www.x-com.se/produktioner/webbplatser#malarbaten-webbplats</link>
		<comments>http://www.x-com.se/produktioner/webbplatser#malarbaten-webbplats#comments</comments>
		<pubDate>Tue, 18 Mar 2008 13:10:57 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Webbplatser]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=529</guid>
		<description><![CDATA[Tillsammans med Ovland and Friends har vi gjort en ny ...]]></description>
			<content:encoded><![CDATA[<p>Tillsammans med Ovland and Friends har vi gjort en ny webbplats åt Mälarbåten.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/webbplatser#malarbaten-webbplats/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Com Hem &#8211; Under stjärnorna</title>
		<link>http://www.x-com.se/produktioner/kampanjer#com-hem-under-stjarnorna</link>
		<comments>http://www.x-com.se/produktioner/kampanjer#com-hem-under-stjarnorna#comments</comments>
		<pubDate>Sat, 15 Dec 2007 15:12:48 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Kampanjer]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=680</guid>
		<description><![CDATA[Tillsammans med Foreign har vi gjort en kampanj för Com ...]]></description>
			<content:encoded><![CDATA[<p>Tillsammans med Foreign har vi gjort en kampanj för Com Hem. Kampanjen lanserades stort i samband med Lucia 2007 och vi gjorde kampanjsajten och webbannonser.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/kampanjer#com-hem-under-stjarnorna/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eskilstuna Logistik</title>
		<link>http://www.x-com.se/produktioner/webbplatser#eskilstuna-logistik</link>
		<comments>http://www.x-com.se/produktioner/webbplatser#eskilstuna-logistik#comments</comments>
		<pubDate>Fri, 26 Oct 2007 11:04:10 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Webbplatser]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=826</guid>
		<description><![CDATA[Tillsammans med reklambyrån Ovland and Friends har vi tagit fram ...]]></description>
			<content:encoded><![CDATA[<p>Tillsammans med reklambyrån Ovland and Friends har vi tagit fram en ny webbplats åt Eskilstuna Logistik. Kampanjen ska hjälpa till att locka fler företag med logistikbehov till Eskilstuna.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/webbplatser#eskilstuna-logistik/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Work Agent AB</title>
		<link>http://www.x-com.se/produktioner/webbplatser#work-agent-ab</link>
		<comments>http://www.x-com.se/produktioner/webbplatser#work-agent-ab#comments</comments>
		<pubDate>Fri, 21 Sep 2007 14:58:25 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Webbplatser]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=712</guid>
		<description><![CDATA[Vi har gjort en ny webbplats åt rekryteringsföretaget Work Agent ...]]></description>
			<content:encoded><![CDATA[<p>Vi har gjort en ny webbplats åt rekryteringsföretaget Work Agent AB.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/webbplatser#work-agent-ab/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Energikontoret &#8211; Webbplats</title>
		<link>http://www.x-com.se/produktioner/webbplatser#energikontoret-webbplats</link>
		<comments>http://www.x-com.se/produktioner/webbplatser#energikontoret-webbplats#comments</comments>
		<pubDate>Tue, 18 Sep 2007 20:28:55 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Webbplatser]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=678</guid>
		<description><![CDATA[Tillsammans med reklambyrån Järv har vi tagit fram en ny ...]]></description>
			<content:encoded><![CDATA[<p>Tillsammans med reklambyrån Järv har vi tagit fram en ny webbplats åt Energikontoret i Mälardalen.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/webbplatser#energikontoret-webbplats/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SAS &#8211; USA Kampanj</title>
		<link>http://www.x-com.se/produktioner/kampanjer#sas-usa-kampanj</link>
		<comments>http://www.x-com.se/produktioner/kampanjer#sas-usa-kampanj#comments</comments>
		<pubDate>Fri, 08 Jun 2007 12:38:28 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Kampanjer]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=843</guid>
		<description><![CDATA[Vi har hjälp reklambyrån Pool med en kampanj för SAS.
]]></description>
			<content:encoded><![CDATA[<p>Vi har hjälp reklambyrån Pool med en kampanj för SAS.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/kampanjer#sas-usa-kampanj/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Swilkenbridge &#8211; Navigating your journey</title>
		<link>http://www.x-com.se/produktioner/webbplatser#swilkenbridge-navigating-your-journey</link>
		<comments>http://www.x-com.se/produktioner/webbplatser#swilkenbridge-navigating-your-journey#comments</comments>
		<pubDate>Mon, 07 May 2007 09:36:23 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Webbplatser]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=690</guid>
		<description><![CDATA[Vi har tagit fram en ny webbplats åt Swilkenbridge, ett ...]]></description>
			<content:encoded><![CDATA[<p>Vi har tagit fram en ny webbplats åt Swilkenbridge, ett väldigt framgångsrikt företag med affärsutveckling som verksamhet.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/webbplatser#swilkenbridge-navigating-your-journey/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>adidas &#8211; Impossible Team</title>
		<link>http://www.x-com.se/produktioner/kampanjer#adidas-impossible-team</link>
		<comments>http://www.x-com.se/produktioner/kampanjer#adidas-impossible-team#comments</comments>
		<pubDate>Mon, 22 May 2006 08:12:26 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Kampanjer]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=798</guid>
		<description><![CDATA[Inför Fotbolls-VM 2006 i Tyskland satsar Adidas hårt och vi ...]]></description>
			<content:encoded><![CDATA[<p>Inför Fotbolls-VM 2006 i Tyskland satsar Adidas hårt och vi har hjälpt deras digitala byrå Foreign med kampanjen Impossible Team. Kampanjen lanseras globalt på totalt 18 olika språk.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/kampanjer#adidas-impossible-team/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Intersport &#8211; adidas +F50 Tunit</title>
		<link>http://www.x-com.se/produktioner/kampanjer#intersport-adidas-f50-tunit</link>
		<comments>http://www.x-com.se/produktioner/kampanjer#intersport-adidas-f50-tunit#comments</comments>
		<pubDate>Wed, 01 Mar 2006 09:27:45 +0000</pubDate>
		<dc:creator>Per</dc:creator>
				<category><![CDATA[Kampanjer]]></category>

		<guid isPermaLink="false">http://devx.x-com.se/?p=809</guid>
		<description><![CDATA[På uppdrag av webbyrån Foreign uppdaterade vi sajten www.wherefootballstarts.com med ...]]></description>
			<content:encoded><![CDATA[<p>På uppdrag av webbyrån Foreign uppdaterade vi sajten www.wherefootballstarts.com med kampanjen +F50 Tunit. Sajten är en samproduktion mellan Intersport och Adidas och mycket av innehåller kommer från adidas.com/football.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x-com.se/produktioner/kampanjer#intersport-adidas-f50-tunit/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
