<?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>Robert Muller Design &#187; Flash</title>
	<atom:link href="http://rmd.com.au/archives/category/flash/feed" rel="self" type="application/rss+xml" />
	<link>http://rmd.com.au</link>
	<description></description>
	<lastBuildDate>Tue, 12 Oct 2010 23:47:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Flash Motion Blur Sprite Source</title>
		<link>http://rmd.com.au/archives/flash-motion-blur-sprite-source</link>
		<comments>http://rmd.com.au/archives/flash-motion-blur-sprite-source#comments</comments>
		<pubDate>Mon, 24 Aug 2009 16:17:58 +0000</pubDate>
		<dc:creator>Rob Muller</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Source]]></category>
		<category><![CDATA[blur]]></category>
		<category><![CDATA[motion blur]]></category>
		<category><![CDATA[sprite]]></category>

		<guid isPermaLink="false">http://rmd.com.au/?p=353</guid>
		<description><![CDATA[I&#8217;ve finally found some time to clean up my MotionBlurSprite source and make it interchangeable with Flash&#8217;s Sprite class. Features Almost completely interchangeable with Sprite class (see caveats). Ability to specify blur by angle &#038; distance, or by vector (dx, dy) &#8211; the latter is perfect for blurring based on the sprite&#8217;s velocity. Transforms (rotate, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve finally found some time to clean up my MotionBlurSprite source and make it interchangeable with Flash&#8217;s Sprite class.</p>
<h3>Features</h3>
<ul>
<li>Almost completely interchangeable with Sprite class (see caveats).</li>
<li>Ability to specify blur by angle &#038; distance, or by vector (dx, dy) &#8211; the latter is perfect for blurring based on the sprite&#8217;s velocity.</li>
<li>Transforms (rotate, scale etc) affect the filtered sprite, unlike normal Flash filters which are applied after transforms.</li>
</ul>
<h3>Caveats</h3>
<ul>
<li>No mouse interaction with children, although I&#8217;m planning to add child mouse interaction in future.</li>
<li>Sprite size is limited to Flash&#8217;s maximum bitmap size of 2880&#215;2880.</li>
<li>Need to call blur(), blur2() or update() after changes to graphics or children. It&#8217;s best just to call the relevent blur() method on enterFrame after all other updates have been made.</li>
</ul>
<p>I&#8217;d love to know if you use this class in your project &#8211; please <a href="/contact">let me know</a>.</p>
<p><a href="/labs/source/MotionBlurSprite_v1.02.zip">Download MotionBlurSprite_v1.02.zip</a></p>
<p>Here&#8217;s a basic demo of the class with angle and distance controls and the ability to add/remove children and draw to graphics on-the-fly. The standard Flash Sprite is on the left and MotionBlurSprite is on the right. The method calls to add/remove children and draw graphics on both are identical. Thanks to Keith Peters for his awesome little <a href="http://www.bit-101.com/blog/?p=1126">MinimalComps UI components</a> &#8211; very handy for things like this.</p>
<p><a href="/labs/motion-blur-test/"><img src="/wp-content/uploads/2009/08/motion_blur_test.jpg" alt="Motion Blur Demo" title="Motion Blur Demo" width="420" height="280" class="alignnone size-full wp-image-369" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://rmd.com.au/archives/flash-motion-blur-sprite-source/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Sony Quantum Code Award Wrap-up</title>
		<link>http://rmd.com.au/archives/sony-quantum-code-award-wrap-up</link>
		<comments>http://rmd.com.au/archives/sony-quantum-code-award-wrap-up#comments</comments>
		<pubDate>Mon, 24 Aug 2009 16:13:23 +0000</pubDate>
		<dc:creator>Rob Muller</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[My Work]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[AdFest]]></category>
		<category><![CDATA[ADMA]]></category>
		<category><![CDATA[AIMIA]]></category>
		<category><![CDATA[APMA]]></category>
		<category><![CDATA[ARG]]></category>
		<category><![CDATA[Cannes]]></category>
		<category><![CDATA[D&AD]]></category>
		<category><![CDATA[Euro RSCG]]></category>
		<category><![CDATA[Massive]]></category>
		<category><![CDATA[QR codes]]></category>
		<category><![CDATA[Quantum Code]]></category>
		<category><![CDATA[Sony]]></category>
		<category><![CDATA[Webby]]></category>

		<guid isPermaLink="false">http://rmd.com.au/?p=372</guid>
		<description><![CDATA[This will be my last post on this &#8211; I promise. :) While at my previous role at Massive, I had the privilege to work with some incredibly talented people on some fairly heavily-awarded projects, such as V8 Supercars, the Sydney to Hobart Yacht Tracker and the BigPond Movies Viiv application. After leaving Massive I [...]]]></description>
			<content:encoded><![CDATA[<p>This will be my last post on this &#8211; I promise. :)</p>
<p>While at my previous role at <a href="http://www.massive.com.au/">Massive</a>, I had the privilege to work with some incredibly talented people on some fairly heavily-awarded projects, such as <a href="http://www.v8supercars.com.au/live_race_engine/choose.aspx">V8 Supercars</a>, the <a href="http://rolexsydneyhobart.com/yacht_tracker.asp?key=522">Sydney to Hobart Yacht Tracker</a> and the <a href="http://downloads.bigpondmovies.com/viiv/index.html">BigPond Movies Viiv application</a>.</p>
<p>After leaving Massive I didn&#8217;t think I could top that, but one of the first projects I worked on at Euro late last year has come pretty close. Here&#8217;s what we&#8217;ve picked up to date (I might be missing a few more):</p>
<h3>Awards</h3>
<ul>
<li><a href="http://www.aimia.com.au/i-cms?page=5673">AIMIA</a>
<ul>
<li>Best Use Of Social Media</li>
<li>Best Word-of-Mouth, Peer-to-Peer or Viral</li>
</ul>
</li>
<li><a href="http://www.adfest.com/press_center/finalist-winner3.aspx?Lotus=6&#038;search=Lotus&#038;Type=2&#038;cate=220">Adfest Silver Lotus (Cyber) &#8211; Mobile</a></li>
<li><a href="http://www.apma.com/images/stories/APMA-Star-Awards-2009-winners.pdf">APMA</a>
<ul>
<li>Gold &#8211; Best Integrated Communications Campaign</li>
<li>Gold &#8211; Best Sponsorship or Tie-in Campaign</li>
<li>Gold &#8211; Best Digital/Interactive Campaign</li>
</ul>
</li>
<li><a href="http://www.media.asia/DigitalMedia/Awards/2009/winners.html">Digital Media Awards Aisa</a>
<ul>
<li>Silver &#8211; Best Mobile</li>
<li>Silver &#8211; Best Viral Marketing</li>
</ul>
</li>
<li><a href="http://www.admaawards.com.au/">ADMA</a>
<ul>
<li>Bronze &#8211; Mobile &#038; Wireless</li>
<li>Bronze &#8211; Retail &#038; Packaged Goods</li>
</ul>
</li>
<li><a href="http://www.maaw.org/globesAwards/winners.aspx">MAA Globes &#8211; Bronze: Best Sponsorship or Tie-In Campaign</a></li>
<li><a href="http://mmaglobal.com/news/five-asia-pacific-campaigns-win-top-honors-2009-mma-mobile-marketing-awards">Global MMA Awards</a>
<ul>
<li>Best Multi-Mobile Channel Campaign</li>
<li>Best Mobile Social Media Campaign</li>
</ul>
</li>
</ul>
<h3>Nominations</h3>
<ul>
<li><a href="http://work.canneslions.com/promo/entry.cfm?entryid=1150">Cannes Promo Lion</a></li>
<li><a href="http://awards.dandad.org/2009/categories/mmkt/mobile-marketing/17325/quantum-code">D&#038;AD &#8211; Yellow Pencil for Mobile Marketing</a></li>
<li><a href="http://www.webbyawards.com/webbys/current.php?media_id=127&#038;season=13#Integrated%20Mobile%20Experience">Webby Award &#8211; Integrated Mobile Experience</a></li>
<li><a href="http://www.aimia.com.au/i-cms?page=5673">AIMIA</a>
<ul>
<li>Best Advertising or Marketing</li>
<li>Best Cross-Platform Content or Content Integration with an Offline Advertising Campaign</li>
<li>Mobile Advertising or Marketing</li>
</ul>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://rmd.com.au/archives/sony-quantum-code-award-wrap-up/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Water For Life Microsite using Papervision3D</title>
		<link>http://rmd.com.au/archives/water-for-life</link>
		<comments>http://rmd.com.au/archives/water-for-life#comments</comments>
		<pubDate>Tue, 26 May 2009 13:52:58 +0000</pubDate>
		<dc:creator>Rob Muller</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[Demoscene]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[My Work]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[Euro RSCG]]></category>
		<category><![CDATA[Papervision3D]]></category>

		<guid isPermaLink="false">http://rmd.com.au/?p=336</guid>
		<description><![CDATA[Euro has just launched an integrated campaign for the NSW Government called &#8220;Water For Life&#8221;, which aims to inform the public about new water sources, and ways in which we can use our existing sources more efficiently. The campaign presents a &#8220;day-in-the-life&#8221; view of a water drop&#8217;s journey through our water system, and includes TV [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.waterforlife.com.au/"><img src="/wp-content/uploads/2009/05/water4life_01.jpg" alt="Water4Life Homepage" title="Water4Life Homepage" width="420" height="236" class="alignnone size-full wp-image-338" /></a></p>
<p>Euro has just launched an integrated campaign for the NSW Government called &#8220;Water For Life&#8221;, which aims to inform the public about new water sources, and ways in which we can use our existing sources more efficiently. The campaign presents a &#8220;day-in-the-life&#8221; view of a water drop&#8217;s journey through our water system, and includes TV commercials, printed and online advertising, and a microsite.</p>
<p>The aim of the microsite was to unify the journeys presented in each TV commercial, and provide a little more depth of information without becoming too heavy on details. We wanted to reuse and maintain the visual style of the TVCs, with the almost anthropomorphic focus on the water drop itself, so we decided to build a set of 3D scenes where people could discover additional information on water efficiency at various points on the drop&#8217;s journey.</p>
<p><a href="http://www.waterforlife.com.au/"><img src="/wp-content/uploads/2009/05/water4life_02b.jpg" alt="Water4Life Bathroom Scene" title="Water4Life Bathroom Scene" width="420" height="236" class="alignnone size-full wp-image-339" /></a></p>
<p>We used Papervision3D to render the scenes, which were partly modelled in 3D Studio Max and textured using a combination of texture-baking in 3DS and plenty of post-production in Photoshop. Then additional elements were added directly in Papervision, such as the refractive water drop, depth-of-field particles, tree decals, skyboxes, lens flares, etc.</p>
<p><a href="http://www.waterforlife.com.au/"><img src="/wp-content/uploads/2009/05/water4life_03.jpg" alt="Water4Life Map Scene" title="Water4Life Map Scene" width="420" height="236" class="alignnone size-full wp-image-337" /></a></p>
<p>I&#8217;m really happy with the final result, as well as the performance of the 3D scenes thanks to some optimisation tricks and techniques. I&#8217;m planning on doing a series of posts going into further detail on some of the effects and optimisation techniques, including source code where possible. If there&#8217;s anything specific you&#8217;d like me to cover, leave a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://rmd.com.au/archives/water-for-life/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Easter Egg a Bastard</title>
		<link>http://rmd.com.au/archives/easter-egg-a-bastard</link>
		<comments>http://rmd.com.au/archives/easter-egg-a-bastard#comments</comments>
		<pubDate>Wed, 22 Apr 2009 14:20:23 +0000</pubDate>
		<dc:creator>Rob Muller</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[My Work]]></category>
		<category><![CDATA[Physics]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Democrats]]></category>
		<category><![CDATA[Easter]]></category>
		<category><![CDATA[Euro RSCG]]></category>

		<guid isPermaLink="false">http://rmd.com.au/?p=319</guid>
		<description><![CDATA[A couple of weeks back just prior to the Easter weekend Euro RSCG launched another campaign for the Australian Democrats. Called &#8220;Easter Egg a Bastard&#8221; &#8211; pick a politician&#8217;s website, or enter your own URL and then egg the page. I&#8217;m happy with the way I&#8217;ve seamlessly combined timeline animation with scripted animation. The bunny [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of weeks back just prior to the Easter weekend <a href="http://www.eurorscg.com.au/">Euro RSCG</a> launched another campaign for the Australian Democrats. Called <a href="http://www.bastardwatch.com.au/easteregg/">&#8220;Easter Egg a Bastard&#8221;</a> &#8211; pick a politician&#8217;s website, or enter your own URL and then egg the page.</p>
<p><a href="http://www.bastardwatch.com.au/easteregg/"><img src="/wp-content/uploads/2009/04/easter_egg.jpg" alt="easter_egg" title="easter_egg" width="420" height="267" class="alignnone size-full wp-image-320" /></a></p>
<p>I&#8217;m happy with the way I&#8217;ve seamlessly combined timeline animation with scripted animation. The bunny and egg are controlled using timeline animation right up until the egg hits the slingshot pouch. From then on it&#8217;s all ActionScript.</p>
<p>The timeline animation is triggered from ActionScript using good old gotoAndPlay(), and when each animation finishes, the bunny&#8217;s timeline calls stop() and then broadcasts an event back out to the view class controlling the bunny. The bunny SWF is embedded at compile time which would normally cause any ActionScript to be stripped out, so I used this method of <a href="http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&#038;productId=2&#038;postId=12871">preserving timeline code in embedded assets</a>. Read the comment on that post though &#8211; I also found that waiting one frame often wasn&#8217;t enough. I simply added a check for the existence of loader.content in the enterFrame handler before continuing.</p>
<p>I also love the feel of the slingshot physics &#8211; it took a fair bit of tweaking to get right. The feeling of depth as you pull back on the slingshot is faked. No Z dimension &#8211; the pouch &#038; egg are just scaling based on their Y position. This meant that I didn&#8217;t need to do any converting back and forth between 3D and 2D coordinates to draw the rubber strips. Once the egg leaves the slingshot however, proper 3D takes over and the egg is positioned &#038; scaled based on its Z coordinate. When budget or schedule (or both!) are tight, it&#8217;s essential to keep things simple and not over-engineer.</p>
]]></content:encoded>
			<wfw:commentRss>http://rmd.com.au/archives/easter-egg-a-bastard/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quantum Code Nominated for a Webby</title>
		<link>http://rmd.com.au/archives/quantum-code-nominated-for-a-webby</link>
		<comments>http://rmd.com.au/archives/quantum-code-nominated-for-a-webby#comments</comments>
		<pubDate>Wed, 22 Apr 2009 13:50:27 +0000</pubDate>
		<dc:creator>Rob Muller</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[My Work]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[AIMIA]]></category>
		<category><![CDATA[ARG]]></category>
		<category><![CDATA[Euro RSCG]]></category>
		<category><![CDATA[QR codes]]></category>
		<category><![CDATA[Quantum Code]]></category>
		<category><![CDATA[Sony]]></category>

		<guid isPermaLink="false">http://rmd.com.au/?p=329</guid>
		<description><![CDATA[Another (potential) success for Euro &#038; Sony&#8217;s Quantum Code campaign &#8211; nominated for a Webby in the Integrated Mobile Experience category. You can choose your pick for best of the Net by voting at the Webby People&#8217;s Voice site.]]></description>
			<content:encoded><![CDATA[<p>Another (potential) success for Euro &#038; Sony&#8217;s <a href="/archives/tag/quantum-code">Quantum Code</a> campaign &#8211; <a href="http://www.webbyawards.com/webbys/current.php?media_id=127&#038;season=13#Integrated%20Mobile%20Experience">nominated for a Webby</a> in the Integrated Mobile Experience category.</p>
<p>You can choose your pick for best of the Net by voting at the <a href="http://pv.webbyawards.com/">Webby People&#8217;s Voice site</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://rmd.com.au/archives/quantum-code-nominated-for-a-webby/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash Smoke Effect using DisplacementMapFilter</title>
		<link>http://rmd.com.au/archives/flash-smoke-effect-using-displacementmapfilter</link>
		<comments>http://rmd.com.au/archives/flash-smoke-effect-using-displacementmapfilter#comments</comments>
		<pubDate>Tue, 31 Mar 2009 13:23:04 +0000</pubDate>
		<dc:creator>Rob Muller</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[My Work]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[DisplacementMapFilter]]></category>
		<category><![CDATA[smoke]]></category>

		<guid isPermaLink="false">http://rmd.com.au/?p=308</guid>
		<description><![CDATA[Inspired by David Lenaerts&#8217; awesome smoke simulation using Alchemy, I wondered if a similar effect &#8211; pushing smoke around with the mouse &#8211; could be achieved using Flash&#8217;s DisplacementMapFilter. As with David&#8217;s simulation, click to add smoke and move the mouse to create wind. There&#8217;s a great explanation of how DisplacementMapFilter works over at Emanuele [...]]]></description>
			<content:encoded><![CDATA[<p>Inspired by David Lenaerts&#8217; awesome <a href="http://www.derschmale.com/2009/03/23/experimenting-with-alchemy-of-smoke-milk-and-ink/">smoke simulation using Alchemy</a>, I wondered if a similar effect &#8211; pushing smoke around with the mouse &#8211; could be achieved using Flash&#8217;s <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/filters/DisplacementMapFilter.html">DisplacementMapFilter</a>. As with David&#8217;s simulation, click to add smoke and move the mouse to create wind.</p>
<p><a href="/labs/displacement-smoke/"><img class="alignnone size-full wp-image-309" title="displacement_smoke" src="/wp-content/uploads/2009/03/displacement_smoke.jpg" alt="displacement_smoke" width="420" height="210" /></a></p>
<p>There&#8217;s a great explanation of <a href="http://www.emanueleferonato.com/2007/12/03/understanding-flash-displacement-map-filter/">how DisplacementMapFilter works</a> over at Emanuele Feronato&#8217;s blog, so I won&#8217;t repeat it here. The smoke effect is on the left, and on the right is the displacement bitmap that gets applied to the smoke image on each frame. To simulate wind, as the mouse is moved I add or subtract from the red and green channels using ColorTransform. The faster the mouse is moved, the more I add or subtract. To simulate the wind settling down, I apply a BlurFilter and another ColorTransform to cause the displacement map to converge towards 0x80C000 (no horizontal movement, slight upwards movement).</p>
<p>While not nearly as impressive as David&#8217;s more realistic simulation, I&#8217;m pretty happy with what can be achieved with simple bitmap displacement. I experimented with adding Perlin noise to prevent the smoke from getting too static when the mouse isn&#8217;t moving and got some really cool results, but have decided to keep things simple for now. Maybe in a future post.</p>
<p>Here&#8217;s the source. It was built in FlexBuilder as an ActionScript project, but wouldn&#8217;t be hard to convert to compile in the Flash IDE.</p>
<div class="codecolorer-container actionscript3 default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #9900cc; font-weight: bold;">package</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=bitmap%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:bitmap.html"><span style="color: #004993;">Bitmap</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=bitmapdata%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:bitmapdata.html"><span style="color: #004993;">BitmapData</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=sprite%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:sprite.html"><span style="color: #004993;">Sprite</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=event%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:event.html"><span style="color: #004993;">Event</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.filters</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=blurfilter%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:blurfilter.html"><span style="color: #004993;">BlurFilter</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.filters</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=displacementmapfilter%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:displacementmapfilter.html"><span style="color: #004993;">DisplacementMapFilter</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.geom</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=colortransform%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:colortransform.html"><span style="color: #004993;">ColorTransform</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.geom</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=point%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:point.html"><span style="color: #004993;">Point</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.geom</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=rectangle%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:rectangle.html"><span style="color: #004993;">Rectangle</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000;">&#91;</span>SWF<span style="color: #000000;">&#40;</span><span style="color: #004993;">width</span>=<span style="color: #990000;">'1024'</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">'512'</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">frameRate</span>=<span style="color: #990000;">'30'</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> DisplacementSmoke <span style="color: #0033ff; font-weight: bold;">extends</span> <a href="http://www.google.com/search?q=sprite%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:sprite.html"><span style="color: #004993;">Sprite</span></a><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">internal</span> static <span style="color: #6699cc; font-weight: bold;">var</span> BITMAP_WIDTH<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=number%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:number.html"><span style="color: #004993;">Number</span></a> = <span style="color: #000000; font-weight:bold;">512</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">internal</span> static <span style="color: #6699cc; font-weight: bold;">var</span> BITMAP_HEIGHT<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=number%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:number.html"><span style="color: #004993;">Number</span></a> = <span style="color: #000000; font-weight:bold;">512</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">internal</span> static <span style="color: #6699cc; font-weight: bold;">var</span> WIND_SIZE<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=number%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:number.html"><span style="color: #004993;">Number</span></a> = <span style="color: #000000; font-weight:bold;">80</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">internal</span> static <span style="color: #6699cc; font-weight: bold;">var</span> SMOKE_SIZE<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=number%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:number.html"><span style="color: #004993;">Number</span></a> = <span style="color: #000000; font-weight:bold;">10</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">internal</span> <span style="color: #6699cc; font-weight: bold;">var</span> smokeBitmap<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=bitmap%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:bitmap.html"><span style="color: #004993;">Bitmap</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">internal</span> <span style="color: #6699cc; font-weight: bold;">var</span> displacementBitmap<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=bitmap%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:bitmap.html"><span style="color: #004993;">Bitmap</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">internal</span> <span style="color: #6699cc; font-weight: bold;">var</span> drawing<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=boolean%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:boolean.html"><span style="color: #004993;">Boolean</span></a> = <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">internal</span> <span style="color: #6699cc; font-weight: bold;">var</span> xPos<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=number%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:number.html"><span style="color: #004993;">Number</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">internal</span> <span style="color: #6699cc; font-weight: bold;">var</span> yPos<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=number%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:number.html"><span style="color: #004993;">Number</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">internal</span> <span style="color: #6699cc; font-weight: bold;">var</span> displacementFilter<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=displacementmapfilter%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:displacementmapfilter.html"><span style="color: #004993;">DisplacementMapFilter</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">internal</span> <span style="color: #6699cc; font-weight: bold;">var</span> blurFilter<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=blurfilter%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:blurfilter.html"><span style="color: #004993;">BlurFilter</span></a> = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=blurfilter%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:blurfilter.html"><span style="color: #004993;">BlurFilter</span></a><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">3</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">3</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">internal</span> <span style="color: #6699cc; font-weight: bold;">var</span> windColorTransform<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=colortransform%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:colortransform.html"><span style="color: #004993;">ColorTransform</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">internal</span> <span style="color: #6699cc; font-weight: bold;">var</span> smokeColorTransform<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=colortransform%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:colortransform.html"><span style="color: #004993;">ColorTransform</span></a> = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=colortransform%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:colortransform.html"><span style="color: #004993;">ColorTransform</span></a><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">20</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">20</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">20</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">internal</span> <span style="color: #6699cc; font-weight: bold;">var</span> dampingColorTransform<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=colortransform%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:colortransform.html"><span style="color: #004993;">ColorTransform</span></a> = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=colortransform%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:colortransform.html"><span style="color: #004993;">ColorTransform</span></a><span style="color: #000000;">&#40;</span><span style="color: #000066; font-weight: bold;">.</span>97<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000066; font-weight: bold;">.</span>96<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">5</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">9</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">internal</span> <span style="color: #6699cc; font-weight: bold;">var</span> heatColorTransform<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=colortransform%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:colortransform.html"><span style="color: #004993;">ColorTransform</span></a> = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=colortransform%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:colortransform.html"><span style="color: #004993;">ColorTransform</span></a><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">2</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">internal</span> <span style="color: #6699cc; font-weight: bold;">var</span> bitmapRect<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=rectangle%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:rectangle.html"><span style="color: #004993;">Rectangle</span></a> = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=rectangle%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:rectangle.html"><span style="color: #004993;">Rectangle</span></a><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> BITMAP_WIDTH<span style="color: #000066; font-weight: bold;">,</span> BITMAP_HEIGHT<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">internal</span> <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">rect</span><span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=rectangle%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:rectangle.html"><span style="color: #004993;">Rectangle</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">internal</span> <span style="color: #6699cc; font-weight: bold;">var</span> p<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=point%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:point.html"><span style="color: #004993;">Point</span></a> = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=point%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:point.html"><span style="color: #004993;">Point</span></a><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> DisplacementSmoke<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; smokeBitmap = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=bitmap%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:bitmap.html"><span style="color: #004993;">Bitmap</span></a><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=bitmapdata%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:bitmapdata.html"><span style="color: #004993;">BitmapData</span></a><span style="color: #000000;">&#40;</span>BITMAP_WIDTH<span style="color: #000066; font-weight: bold;">,</span> BITMAP_HEIGHT<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">,</span> 0x000000<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; displacementBitmap = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=bitmap%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:bitmap.html"><span style="color: #004993;">Bitmap</span></a><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=bitmapdata%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:bitmapdata.html"><span style="color: #004993;">BitmapData</span></a><span style="color: #000000;">&#40;</span>BITMAP_WIDTH<span style="color: #000066; font-weight: bold;">,</span> BITMAP_HEIGHT<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">,</span> 0x80C000<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>smokeBitmap<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>displacementBitmap<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; displacementBitmap<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span> = BITMAP_WIDTH<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">MOUSE_DOWN</span><span style="color: #000066; font-weight: bold;">,</span> mouseDownHandler<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">MOUSE_UP</span><span style="color: #000066; font-weight: bold;">,</span> mouseUpHandler<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; displacementFilter = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=displacementmapfilter%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:displacementmapfilter.html"><span style="color: #004993;">DisplacementMapFilter</span></a><span style="color: #000000;">&#40;</span>displacementBitmap<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">bitmapData</span><span style="color: #000066; font-weight: bold;">,</span> p<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">2</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">5</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">5</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; smokeBitmap<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">filters</span> = <span style="color: #000000;">&#91;</span>displacementFilter<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?q=event%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:event.html"><span style="color: #004993;">Event</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ENTER_FRAME</span><span style="color: #000066; font-weight: bold;">,</span> enterFrameHandler<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">internal</span> <span style="color: #339966; font-weight: bold;">function</span> mouseDownHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; drawing = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">internal</span> <span style="color: #339966; font-weight: bold;">function</span> mouseUpHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; drawing = <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">internal</span> <span style="color: #339966; font-weight: bold;">function</span> enterFrameHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=event%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:event.html"><span style="color: #004993;">Event</span></a><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> i<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=number%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:number.html"><span style="color: #004993;">Number</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> j<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=number%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:number.html"><span style="color: #004993;">Number</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> mx<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=number%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:number.html"><span style="color: #004993;">Number</span></a> = <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">mouseX</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> my<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=number%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:number.html"><span style="color: #004993;">Number</span></a> = <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">mouseY</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> dx<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=number%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:number.html"><span style="color: #004993;">Number</span></a> = mx <span style="color: #000066; font-weight: bold;">-</span> xPos<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> dy<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=number%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:number.html"><span style="color: #004993;">Number</span></a> = my <span style="color: #000066; font-weight: bold;">-</span> yPos<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">d</span><span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=number%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:number.html"><span style="color: #004993;">Number</span></a> = <a href="http://www.google.com/search?q=math%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:math.html"><span style="color: #004993;">Math</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">sqrt</span><span style="color: #000000;">&#40;</span>dx<span style="color: #000066; font-weight: bold;">*</span>dx <span style="color: #000066; font-weight: bold;">+</span> dy<span style="color: #000066; font-weight: bold;">*</span>dy<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> step<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=number%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:number.html"><span style="color: #004993;">Number</span></a> = <span style="color: #000066; font-weight: bold;">.</span>6 <span style="color: #000066; font-weight: bold;">-</span> <a href="http://www.google.com/search?q=math%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:math.html"><span style="color: #004993;">Math</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">min</span><span style="color: #000000;">&#40;</span><span style="color: #000066; font-weight: bold;">.</span>5<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">d</span><span style="color: #000066; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">100</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> xp<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=number%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:number.html"><span style="color: #004993;">Number</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> yp<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=number%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:number.html"><span style="color: #004993;">Number</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; windColorTransform = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=colortransform%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:colortransform.html"><span style="color: #004993;">ColorTransform</span></a><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000066; font-weight: bold;">-</span>dx<span style="color: #000066; font-weight: bold;">*.</span>5<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000066; font-weight: bold;">-</span>dy<span style="color: #000066; font-weight: bold;">*.</span>5<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">for</span><span style="color: #000000;">&#40;</span>i=<span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">;</span> i<span style="color: #000066; font-weight: bold;">&lt;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">;</span> i<span style="color: #000066; font-weight: bold;">+</span>=step<span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xp = xPos <span style="color: #000066; font-weight: bold;">+</span> dx<span style="color: #000066; font-weight: bold;">*</span>i<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; yp = yPos <span style="color: #000066; font-weight: bold;">+</span> dy<span style="color: #000066; font-weight: bold;">*</span>i<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xp = <a href="http://www.google.com/search?q=math%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:math.html"><span style="color: #004993;">Math</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">max</span><span style="color: #000000;">&#40;</span>xp<span style="color: #000066; font-weight: bold;">,</span> WIND_SIZE<span style="color: #000066; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xp = <a href="http://www.google.com/search?q=math%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:math.html"><span style="color: #004993;">Math</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">min</span><span style="color: #000000;">&#40;</span>xp<span style="color: #000066; font-weight: bold;">,</span> BITMAP_WIDTH <span style="color: #000066; font-weight: bold;">-</span> WIND_SIZE<span style="color: #000066; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; yp = <a href="http://www.google.com/search?q=math%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:math.html"><span style="color: #004993;">Math</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">max</span><span style="color: #000000;">&#40;</span>yp<span style="color: #000066; font-weight: bold;">,</span> WIND_SIZE<span style="color: #000066; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; yp = <a href="http://www.google.com/search?q=math%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:math.html"><span style="color: #004993;">Math</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">min</span><span style="color: #000000;">&#40;</span>yp<span style="color: #000066; font-weight: bold;">,</span> BITMAP_HEIGHT <span style="color: #000066; font-weight: bold;">-</span> WIND_SIZE<span style="color: #000066; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span><span style="color: #000066; font-weight: bold;">!</span><span style="color: #000000;">&#40;</span>xPos==<span style="color: #000000; font-weight:bold;">0</span> <span style="color: #000066; font-weight: bold;">&amp;&amp;</span> yPos==<span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">rect</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=rectangle%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:rectangle.html"><span style="color: #004993;">Rectangle</span></a><span style="color: #000000;">&#40;</span>xp <span style="color: #000066; font-weight: bold;">-</span> WIND_SIZE<span style="color: #000066; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">2</span> <span style="color: #000066; font-weight: bold;">+</span> <a href="http://www.google.com/search?q=math%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:math.html"><span style="color: #004993;">Math</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span><span style="color: #000000; font-weight:bold;">10</span><span style="color: #000066; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">5</span><span style="color: #000066; font-weight: bold;">,</span> yp <span style="color: #000066; font-weight: bold;">-</span> WIND_SIZE<span style="color: #000066; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">2</span> <span style="color: #000066; font-weight: bold;">+</span> <a href="http://www.google.com/search?q=math%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:math.html"><span style="color: #004993;">Math</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span><span style="color: #000000; font-weight:bold;">10</span><span style="color: #000066; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">5</span><span style="color: #000066; font-weight: bold;">,</span> WIND_SIZE<span style="color: #000066; font-weight: bold;">,</span> WIND_SIZE<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; displacementBitmap<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">bitmapData</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">colorTransform</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">rect</span><span style="color: #000066; font-weight: bold;">,</span> windColorTransform<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>drawing<span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; displacementBitmap<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">bitmapData</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">colorTransform</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">rect</span><span style="color: #000066; font-weight: bold;">,</span> heatColorTransform<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</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 style="color: #0033ff; font-weight: bold;">for</span><span style="color: #000000;">&#40;</span>j=<span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">;</span> j<span style="color: #000066; font-weight: bold;">&lt;</span><span style="color: #000000; font-weight:bold;">4</span><span style="color: #000066; font-weight: bold;">;</span> j<span style="color: #000066; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">rect</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=rectangle%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:rectangle.html"><span style="color: #004993;">Rectangle</span></a><span style="color: #000000;">&#40;</span>xp <span style="color: #000066; font-weight: bold;">-</span> <a href="http://www.google.com/search?q=math%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:math.html"><span style="color: #004993;">Math</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span>SMOKE_SIZE<span style="color: #000066; font-weight: bold;">,</span> yp <span style="color: #000066; font-weight: bold;">-</span> <a href="http://www.google.com/search?q=math%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:math.html"><span style="color: #004993;">Math</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span>SMOKE_SIZE<span style="color: #000066; font-weight: bold;">,</span> SMOKE_SIZE<span style="color: #000066; font-weight: bold;">,</span> SMOKE_SIZE<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; smokeBitmap<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">bitmapData</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">colorTransform</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">rect</span><span style="color: #000066; font-weight: bold;">,</span> smokeColorTransform<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; displacementBitmap<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">bitmapData</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">colorTransform</span><span style="color: #000000;">&#40;</span>bitmapRect<span style="color: #000066; font-weight: bold;">,</span> dampingColorTransform<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; displacementBitmap<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">bitmapData</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">applyFilter</span><span style="color: #000000;">&#40;</span>displacementBitmap<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">bitmapData</span><span style="color: #000066; font-weight: bold;">,</span> bitmapRect<span style="color: #000066; font-weight: bold;">,</span> p<span style="color: #000066; font-weight: bold;">,</span> blurFilter<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xPos = mx<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; yPos = my<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; smokeBitmap<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">bitmapData</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">draw</span><span style="color: #000000;">&#40;</span>smokeBitmap<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<span style="color: #000000;">&#125;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://rmd.com.au/archives/flash-smoke-effect-using-displacementmapfilter/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Euro RSCG &amp; Sony Win Two AIMIA Awards</title>
		<link>http://rmd.com.au/archives/euro-rscg-sony-win-two-aimia-awards</link>
		<comments>http://rmd.com.au/archives/euro-rscg-sony-win-two-aimia-awards#comments</comments>
		<pubDate>Tue, 17 Mar 2009 13:06:05 +0000</pubDate>
		<dc:creator>Rob Muller</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[My Work]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[AIMIA]]></category>
		<category><![CDATA[ARG]]></category>
		<category><![CDATA[Euro RSCG]]></category>
		<category><![CDATA[QR codes]]></category>
		<category><![CDATA[Quantum Code]]></category>
		<category><![CDATA[Sony]]></category>

		<guid isPermaLink="false">http://rmd.com.au/?p=281</guid>
		<description><![CDATA[Hooray! Not much more to add to my previous post on the nominations, except to reiterate &#8211; well done to everyone involved at Euro and Sony. It was the first time I&#8217;ve actually attended an AIMIA Awards night and I had a great time &#8211; caught up with some old friends, and met a few [...]]]></description>
			<content:encoded><![CDATA[<p><a href="/images/aimia_2009_large.jpg"><img src="/wp-content/uploads/2009/03/aimia_2009_small.jpg" alt="Euro AIMIA Awards" title="Euro AIMIA Awards" width="420" height="538" class="alignnone size-full wp-image-284" /></a></p>
<p>Hooray! Not much more to add to <a href="/archives/euros-quantum-code-campaign-nominated-for-5-aimias">my previous post</a> on the nominations, except to reiterate &#8211; well done to everyone involved at Euro and Sony.</p>
<p>It was the first time I&#8217;ve actually attended an AIMIA Awards night and I had a great time &#8211; caught up with some old friends, and met a few new acquaintances as well. Woke up with a spectacular hangover the next morning too.</p>
<p>Congratulations also to <a href="http://www.aimia.com.au/i-cms?page=1.36.5673.5670">all the other award winners</a>.</p>
<p><strong>Update:</strong> Just added a few photos from the night.</p>
<p><img src="/wp-content/uploads/2009/03/aimia_01.jpg" alt="Euro &#038; Michelle/Sony with the first award" title="Euro &#038; Michelle/Sony with the first award" width="420" height="279" class="alignnone size-full wp-image-300" /></p>
<p><img src="/wp-content/uploads/2009/03/aimia_02.jpg" alt="On stage receiving the second award" title="On stage receiving the second award" width="420" height="279" class="alignnone size-full wp-image-300" /></p>
<p><img src="/wp-content/uploads/2009/03/aimia_03.jpg" alt="Second award with the presenter" title="Second award with the presenter" width="420" height="279" class="alignnone size-full wp-image-300" /></p>
<p><img src="/wp-content/uploads/2009/03/aimia_04.jpg" alt="Euro &#038; Michelle" title="Euro &#038; Michelle" width="420" height="279" class="alignnone size-full wp-image-300" /></p>
]]></content:encoded>
			<wfw:commentRss>http://rmd.com.au/archives/euro-rscg-sony-win-two-aimia-awards/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>#tweetcoding Part 5 &#8211; Snake, Cube, Jellycube &amp; Headless Flasher</title>
		<link>http://rmd.com.au/archives/tweetcoding-part-5-snake-cube-jellycube-headless-flasher</link>
		<comments>http://rmd.com.au/archives/tweetcoding-part-5-snake-cube-jellycube-headless-flasher#comments</comments>
		<pubDate>Sat, 07 Mar 2009 07:50:09 +0000</pubDate>
		<dc:creator>Rob Muller</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[cube]]></category>
		<category><![CDATA[isometric]]></category>
		<category><![CDATA[jelly]]></category>
		<category><![CDATA[snake]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://rmd.com.au/?p=266</guid>
		<description><![CDATA[My next #tweetcoding entry is Snake, a game which needs no introduction. No game here unfortuntely &#8211; just the control mechanism, but I believe this was the first entry to use keyboard input. Use W, A, S and D to control the snake&#8230; although due to the code I&#8217;ve used which interprets keyboard commands into [...]]]></description>
			<content:encoded><![CDATA[<p>My next #tweetcoding entry is <a href="/labs/tweetcoding/snake.html">Snake</a>, a game which needs no introduction. No game here unfortuntely &#8211; just the control mechanism, but I believe this was the first entry to use keyboard input. Use W, A, S and D to control the snake&#8230; although due to the code I&#8217;ve used which interprets keyboard commands into horizontal and vertical velocities, other keys will also affect movement in unexpected ways. Here&#8217;s how it works:</p>
<p>The key codes for W and S (up and down) are 87 and 83, and the key codes for A and D (left and right) are 65 and 68. When a key is pressed, first I check if it is up/down, or left/right by testing whether its keycode is above 80 or not. If below, I subtract 66.5 from the key code, leaving either -1.5 or 1.5, which I use as the X velocity. If above 80, I subtract 85, leaving either -2 or 2, then multiply by .75 to ensure that the X and Y velocities match.</p>
<p>Of course, this means that other keys will also affect either the X or Y velocity at unpredictable speeds.</p>
<p><a href="/labs/tweetcoding/snake.html"><img src="/wp-content/uploads/2009/02/snake.jpg" alt="Snake" title="Snake" width="420" height="305" class="alignnone size-full wp-image-262" /></a></p>
<div class="codecolorer-container actionscript3 default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span><span style="color: #000066; font-weight: bold;">!</span>i<span style="color: #000066; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><span style="color: #004993;">c</span>=q=<span style="color: #000000; font-weight:bold;">85</span><span style="color: #000066; font-weight: bold;">;</span><span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;keyDown&quot;</span><span style="color: #000066; font-weight: bold;">,</span>k<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><span style="color: #339966; font-weight: bold;">function</span> k<span style="color: #000000;">&#40;</span>e<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><span style="color: #004993;">c</span>=e<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">keyCode</span><span style="color: #000000;">&#125;</span>v=h=<span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">;</span>c<span style="color: #000066; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight:bold;">80</span><span style="color: #000066; font-weight: bold;">?</span>v=<span style="color: #000000;">&#40;</span>c<span style="color: #000066; font-weight: bold;">-</span>q<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*.</span>75<span style="color: #000066; font-weight: bold;">:</span>h=c<span style="color: #000066; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">66.5</span><span style="color: #000066; font-weight: bold;">;</span>ls<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">9</span><span style="color: #000066; font-weight: bold;">,</span>i<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>lt<span style="color: #000000;">&#40;</span>q<span style="color: #000066; font-weight: bold;">-</span><span style="color: #000000;">&#40;</span>x<span style="color: #000066; font-weight: bold;">-</span>=h<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">,</span>q<span style="color: #000066; font-weight: bold;">-</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">y</span><span style="color: #000066; font-weight: bold;">+</span>=v<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span></div></div>
<p>Number 12 &#8211; my attempt at creating a <a href="/labs/tweetcoding/cube.html">shaded 3D cube</a> cheats on two levels &#8211; 1: it&#8217;s not correct perspective 3D but isometric 3D, and 2: the &#8220;shading&#8221; is achieved with simple parallel lines which converge to mimic a shading effect as each plane turns away from the camera. The isometric effect is simple to produce &#8211; just scale the parent sprite/clip (in this case stage/root) by around 50%, and then rotate the children.</p>
<p><a href="/labs/tweetcoding/cube.html"><img src="/wp-content/uploads/2009/02/cube.jpg" alt="Cube" title="Cube" width="420" height="305" class="alignnone size-full wp-image-258" /></a></p>
<div class="codecolorer-container actionscript3 default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #004993;">scaleY</span>=<span style="color: #000066; font-weight: bold;">.</span>6<span style="color: #000066; font-weight: bold;">;</span>g<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">clear</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><span style="color: #004993;">x</span>=<span style="color: #000000; font-weight:bold;">275</span><span style="color: #000066; font-weight: bold;">;</span><span style="color: #004993;">y</span>=<span style="color: #000000; font-weight:bold;">130</span><span style="color: #000066; font-weight: bold;">;</span>i<span style="color: #000066; font-weight: bold;">-</span>=<span style="color: #000066; font-weight: bold;">.</span>03<span style="color: #000066; font-weight: bold;">;</span><span style="color: #0033ff; font-weight: bold;">for</span><span style="color: #000000;">&#40;</span>q=<span style="color: #004993;">x</span><span style="color: #000066; font-weight: bold;">;</span>q<span style="color: #000066; font-weight: bold;">-</span>=<span style="color: #000000; font-weight:bold;">5</span><span style="color: #000066; font-weight: bold;">;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>j=m<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">cos</span><span style="color: #000000;">&#40;</span>i<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span><span style="color: #004993;">y</span><span style="color: #000066; font-weight: bold;">;</span>k=s<span style="color: #000000;">&#40;</span>i<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span><span style="color: #004993;">y</span><span style="color: #000066; font-weight: bold;">;</span>mt<span style="color: #000000;">&#40;</span>k<span style="color: #000066; font-weight: bold;">,</span>j<span style="color: #000066; font-weight: bold;">+</span>q<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>ls<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">3</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>lt<span style="color: #000000;">&#40;</span><span style="color: #000066; font-weight: bold;">-</span>j<span style="color: #000066; font-weight: bold;">,</span>k<span style="color: #000066; font-weight: bold;">+</span>q<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>lt<span style="color: #000000;">&#40;</span><span style="color: #000066; font-weight: bold;">-</span>k<span style="color: #000066; font-weight: bold;">,</span>q<span style="color: #000066; font-weight: bold;">-</span>j<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>ls<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>lt<span style="color: #000000;">&#40;</span>j<span style="color: #000066; font-weight: bold;">,</span>q<span style="color: #000066; font-weight: bold;">-</span>k<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>lt<span style="color: #000000;">&#40;</span>k<span style="color: #000066; font-weight: bold;">,</span>j<span style="color: #000066; font-weight: bold;">+</span>q<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span></div></div>
<p><a href="/labs/tweetcoding/jellycube.html">Jellycube</a> was a natural progression from my previous entry, but also inspired by <a href="http://www.youtube.com/watch?v=eOm1uz33AV4">Human Target by Melon Dezign</a>. Melon&#8217;s style was always a big inspiration for my demogroup <a href="http://pouet.net/groups.php?which=1043">Reality</a>, particularly with their de-emphasis on cutting-edge effects in favour of design and humour. However, once again I wasn&#8217;t able to achieve my desired outcome &#8211; instead of squashing &#038; stretching the cube I was restricted to rotation only.</p>
<p><a href="/labs/tweetcoding/jellycube.html"><img src="/wp-content/uploads/2009/02/jellycube.jpg" alt="Jellycube" title="Jellycube" width="420" height="305" class="alignnone size-full wp-image-261" /></a></p>
<div class="codecolorer-container actionscript3 default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #004993;">scaleY</span>=<span style="color: #000066; font-weight: bold;">.</span>4<span style="color: #000066; font-weight: bold;">;</span><span style="color: #004993;">x</span>=<span style="color: #000000; font-weight:bold;">275</span><span style="color: #000066; font-weight: bold;">;</span><span style="color: #0033ff; font-weight: bold;">for</span><span style="color: #000000;">&#40;</span>j=<span style="color: #004993;">y</span>=<span style="color: #000000; font-weight:bold;">160</span><span style="color: #000066; font-weight: bold;">;</span>j<span style="color: #000066; font-weight: bold;">-</span>=<span style="color: #000000; font-weight:bold;">8</span><span style="color: #000066; font-weight: bold;">;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span><span style="color: #000066; font-weight: bold;">!</span>o<span style="color: #000000;">&#91;</span>j<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>o<span style="color: #000000;">&#91;</span>j<span style="color: #000000;">&#93;</span>=<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=bitmap%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:bitmap.html"><span style="color: #004993;">Bitmap</span></a><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=bitmapdata%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:bitmapdata.html"><span style="color: #004993;">BitmapData</span></a><span style="color: #000000;">&#40;</span><span style="color: #004993;">y</span><span style="color: #000066; font-weight: bold;">,</span><span style="color: #004993;">y</span><span style="color: #000066; font-weight: bold;">,</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">,</span>8e8<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>o<span style="color: #000000;">&#91;</span>j<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span>=j<span style="color: #000066; font-weight: bold;">*</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000000;">&#125;</span>o<span style="color: #000000;">&#91;</span>j<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">rotation</span>=s<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>j<span style="color: #000066; font-weight: bold;">+</span>i<span style="color: #000066; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">999</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span><span style="color: #004993;">x</span><span style="color: #000000;">&#125;</span></div></div>
<p>My 14th, and final entry is <a href="/labs/tweetcoding/headlessflasher.html">Headless Flasher</a>, an attempt at creating a stick figure running across the screen. This one was originally inspired by my cat Lucy, but it became pretty obvious that the 140 character limit wouldn&#8217;t allow four legs and a tail, so I switched over to a human stick figure. Unfortunately there was no room to add code for his head (or blood spurting out of his neck for that matter).</p>
<p><a href="/labs/tweetcoding/headlessflasher.html"><img src="/wp-content/uploads/2009/02/headlessflasher.jpg" alt="Headless Flasher" title="Headless Flasher" width="420" height="305" class="alignnone size-full wp-image-260" /></a></p>
<div class="codecolorer-container actionscript3 default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">l=lt<span style="color: #000066; font-weight: bold;">;</span><span style="color: #004993;">scaleX</span>=<span style="color: #004993;">scaleY</span>=<span style="color: #000066; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">20</span><span style="color: #000066; font-weight: bold;">;</span>g<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">clear</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>j=s<span style="color: #000000;">&#40;</span>i<span style="color: #000066; font-weight: bold;">-</span>=<span style="color: #000066; font-weight: bold;">.</span>2<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>k=s<span style="color: #000000;">&#40;</span>i<span style="color: #000066; font-weight: bold;">+</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><span style="color: #004993;">x</span>=x<span style="color: #000066; font-weight: bold;">%</span>650<span style="color: #000066; font-weight: bold;">+</span><span style="color: #000000; font-weight:bold;">3</span><span style="color: #000066; font-weight: bold;">;</span><span style="color: #004993;">y</span>=<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">50</span><span style="color: #000066; font-weight: bold;">+</span>k<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span><span style="color: #000000; font-weight:bold;">6</span><span style="color: #000066; font-weight: bold;">;</span>ls<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>mt<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000066; font-weight: bold;">+</span>j<span style="color: #000066; font-weight: bold;">,</span>k<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>l<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">,</span><span style="color: #000000; font-weight:bold;">4</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>l<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000066; font-weight: bold;">-</span>j<span style="color: #000066; font-weight: bold;">,-</span>k<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>mt<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">,</span><span style="color: #000000; font-weight:bold;">4</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>l<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span><span style="color: #000000; font-weight:bold;">7</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>l<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">+</span>j<span style="color: #000066; font-weight: bold;">,</span><span style="color: #000000; font-weight:bold;">5</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>l<span style="color: #000000;">&#40;</span>j<span style="color: #000066; font-weight: bold;">,</span><span style="color: #000000; font-weight:bold;">4</span><span style="color: #000066; font-weight: bold;">-</span>j<span style="color: #000000;">&#41;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://rmd.com.au/archives/tweetcoding-part-5-snake-cube-jellycube-headless-flasher/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>#tweetcoding Part 4 &#8211; Bubbles, Sineribbon &amp; Feedback Vortex</title>
		<link>http://rmd.com.au/archives/tweetcoding-part-4-bubbles-sineribbon-feedback-vortex</link>
		<comments>http://rmd.com.au/archives/tweetcoding-part-4-bubbles-sineribbon-feedback-vortex#comments</comments>
		<pubDate>Tue, 24 Feb 2009 12:47:52 +0000</pubDate>
		<dc:creator>Rob Muller</dc:creator>
				<category><![CDATA[Beer]]></category>
		<category><![CDATA[Demoscene]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[bubbles]]></category>
		<category><![CDATA[feedback]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://rmd.com.au/?p=214</guid>
		<description><![CDATA[Number eight is Bubbles. Of my #tweetcoding entries, this is possibly my favourite. It&#8217;s nothing special technically, but I love recreating natural/physical phenomena, and to do so in 140 characters is even better. I was inspired when staring into a glass of beer &#8211; unfortunately I was unable to implement a nice amber colour within [...]]]></description>
			<content:encoded><![CDATA[<p>Number eight is <a href="/labs/tweetcoding/bubbles.html">Bubbles</a>. Of my #tweetcoding entries, this is possibly my favourite. It&#8217;s nothing special technically, but I love recreating natural/physical phenomena, and to do so in 140 characters is even better. I was inspired when staring into <a href="https://www.littlecreatures.com.au/">a glass of beer</a> &#8211; unfortunately I was unable to implement a nice amber colour within the constraints.</p>
<p> Love the pseudo-3D parallax effect, random motion, differing colours &#038; transparency. The only thing I would improve is the visual appearance of the bubbles &#8211; it&#8217;d be nice to add some shading. Otherwise I&#8217;m pretty happy with this one.</p>
<p><a href="/labs/tweetcoding/bubbles.html"><img src="/wp-content/uploads/2009/02/bubbles.jpg" alt="bubbles" title="bubbles" width="420" height="305" class="alignnone size-full wp-image-215" /></a></p>
<div class="codecolorer-container actionscript3 default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">g<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">clear</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><span style="color: #0033ff; font-weight: bold;">for</span><span style="color: #000000;">&#40;</span>i=j=<span style="color: #000000; font-weight:bold;">550</span><span style="color: #000066; font-weight: bold;">;</span>i<span style="color: #000066; font-weight: bold;">--;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><span style="color: #000066; font-weight: bold;">!</span>o<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">?</span>o<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span>=<span style="color: #000000;">&#123;</span><span style="color: #004993;">x</span><span style="color: #000066; font-weight: bold;">:</span>r<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span>j<span style="color: #000066; font-weight: bold;">,</span><span style="color: #004993;">y</span><span style="color: #000066; font-weight: bold;">:</span>r<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span>j<span style="color: #000066; font-weight: bold;">,</span>s<span style="color: #000066; font-weight: bold;">:</span>r<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span><span style="color: #000000; font-weight:bold;">9</span><span style="color: #000000;">&#125;</span><span style="color: #000066; font-weight: bold;">:</span>p=o<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">;</span><span style="color: #0033ff; font-weight: bold;">with</span><span style="color: #000000;">&#40;</span>p<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>ls<span style="color: #000000;">&#40;</span>s<span style="color: #000066; font-weight: bold;">,</span>j<span style="color: #000066; font-weight: bold;">+</span>i<span style="color: #000066; font-weight: bold;">,.</span>2<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>mt<span style="color: #000000;">&#40;</span><span style="color: #004993;">x</span><span style="color: #000066; font-weight: bold;">,</span><span style="color: #004993;">y</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>lt<span style="color: #000000;">&#40;</span><span style="color: #004993;">x</span><span style="color: #000066; font-weight: bold;">+</span>=r<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span><span style="color: #000000; font-weight:bold;">4</span><span style="color: #000066; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000066; font-weight: bold;">,</span>y<span style="color: #000066; font-weight: bold;">-</span>=r<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span>p<span style="color: #000066; font-weight: bold;">.</span>s<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>y<span style="color: #000066; font-weight: bold;">&lt;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span><span style="color: #004993;">y</span>=j<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span></div></div>
<p>Nine is <a href="/labs/tweetcoding/sineribbon.html">Sineribbon</a>. This was an attempt to recreate one of my favourite effects, seen here in another classic PC demo &#8211; <a href="http://www.youtube.com/watch?v=_itMu1ZbY6c">X14 by Orange</a> from 1995. Skip to the 2:50 mark to see the effect or, better still, watch the whole thing. Unfortunately for me, the character constraint was too limiting, so I ended up with what you see here. I might try and revisit this one though.</p>
<p><a href="/labs/tweetcoding/sineribbon.html"><img src="/wp-content/uploads/2009/02/sineribbon.jpg" alt="sineribbon" title="sineribbon" width="420" height="305" class="alignnone size-full wp-image-217" /></a></p>
<div class="codecolorer-container actionscript3 default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">q=<span style="color: #000000; font-weight:bold;">200</span><span style="color: #000066; font-weight: bold;">;</span>g<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">clear</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span><span style="color: #000066; font-weight: bold;">!</span>o<span style="color: #000066; font-weight: bold;">.</span>a<span style="color: #000000;">&#41;</span>o<span style="color: #000066; font-weight: bold;">.</span>a=o<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">b</span>=<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">;</span><span style="color: #0033ff; font-weight: bold;">with</span><span style="color: #000000;">&#40;</span>o<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>a<span style="color: #000066; font-weight: bold;">+</span>=<span style="color: #000066; font-weight: bold;">.</span>03<span style="color: #000066; font-weight: bold;">;</span>b<span style="color: #000066; font-weight: bold;">-</span>=<span style="color: #000066; font-weight: bold;">.</span>07<span style="color: #000066; font-weight: bold;">;</span><span style="color: #0033ff; font-weight: bold;">for</span><span style="color: #000000;">&#40;</span>j=<span style="color: #000000; font-weight:bold;">550</span><span style="color: #000066; font-weight: bold;">;</span>j<span style="color: #000066; font-weight: bold;">--;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>p=s<span style="color: #000000;">&#40;</span>j<span style="color: #000066; font-weight: bold;">/</span>q<span style="color: #000066; font-weight: bold;">+</span>s<span style="color: #000000;">&#40;</span>a<span style="color: #000066; font-weight: bold;">+</span>j<span style="color: #000066; font-weight: bold;">/</span>q<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">+</span>s<span style="color: #000000;">&#40;</span><span style="color: #004993;">b</span><span style="color: #000066; font-weight: bold;">+</span>j<span style="color: #000066; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">179</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span>q<span style="color: #000066; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000066; font-weight: bold;">;</span>ls<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">,</span>p<span style="color: #000066; font-weight: bold;">+</span>q<span style="color: #000066; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>mt<span style="color: #000000;">&#40;</span>j<span style="color: #000066; font-weight: bold;">,</span>q<span style="color: #000066; font-weight: bold;">-</span>p<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>lt<span style="color: #000000;">&#40;</span>j<span style="color: #000066; font-weight: bold;">,</span>q<span style="color: #000066; font-weight: bold;">+</span>p<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span></div></div>
<p>Ten &#8211; <a href="/labs/tweetcoding/feedbackvortex.html">Feedback Vortex</a>. Video Feedback goes all the way back to <a href="http://en.wikipedia.org/wiki/Videofeedback">the advent of analogue video</a> back in 1956, although it wasn&#8217;t used purposefully until the 1960s and didn&#8217;t really take off until decades later. Creating this effect in Flash is simple &#8211; just add a bitmap to the stage and, each frame, copy the entire stage into the bitmap, with input image, noise or colour around the bitmap to start the effect off. Over multiple frames, this generates copies of the input image &#8211; each one nested within the last. By adjusting the scale and rotation of the bitmap, the copies can be made to spiral, or zoom in and out.</p>
<p>My favourite demoscene example is again from <a href="http://www.youtube.com/watch?v=_itMu1ZbY6c">X14 by Orange</a>, at the 2:40 mark.</p>
<p>Credit is due to Quasimondo for the <a href="http://twitter.com/Quasimondo/status/1227969633">first #tweetcoding entry to use bitmap feedback</a>, but I&#8217;m no stranger to the effect either, having implemented it in Director back in the day, and <a href="/f8_infinity.html">again in Flash</a> when the FP8 beta was released.</p>
<p><a href="/labs/tweetcoding/feedbackvortex.html"><img src="/wp-content/uploads/2009/02/feedbackvortex.jpg" alt="feedbackvortex" title="feedbackvortex" width="420" height="305" class="alignnone size-full wp-image-216" /></a></p>
<div class="codecolorer-container actionscript3 default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">q=<span style="color: #000000; font-weight:bold;">550</span><span style="color: #000066; font-weight: bold;">;</span>g<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">clear</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span><span style="color: #000066; font-weight: bold;">!</span>o<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">b</span><span style="color: #000000;">&#41;</span><span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>o<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">c</span>=<span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=bitmap%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:bitmap.html"><span style="color: #004993;">Bitmap</span></a><span style="color: #000000;">&#40;</span>o<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">b</span>=<span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=bitmapdata%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:bitmapdata.html"><span style="color: #004993;">BitmapData</span></a><span style="color: #000000;">&#40;</span>q<span style="color: #000066; font-weight: bold;">,</span>q<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">rotation</span>=<span style="color: #000000; font-weight:bold;">2</span><span style="color: #000066; font-weight: bold;">;</span>o<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">c</span><span style="color: #000066; font-weight: bold;">.</span>z=s<span style="color: #000000;">&#40;</span>i<span style="color: #000066; font-weight: bold;">+</span>=<span style="color: #000066; font-weight: bold;">.</span>03<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span><span style="color: #000000; font-weight:bold;">70</span><span style="color: #000066; font-weight: bold;">+</span><span style="color: #000000; font-weight:bold;">30</span><span style="color: #000066; font-weight: bold;">;</span>ls<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">9</span><span style="color: #000066; font-weight: bold;">,</span>i<span style="color: #000066; font-weight: bold;">*</span>q<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>lt<span style="color: #000000;">&#40;</span>q<span style="color: #000066; font-weight: bold;">,</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>o<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">b</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">draw</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://rmd.com.au/archives/tweetcoding-part-4-bubbles-sineribbon-feedback-vortex/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Papervision3D Grass/Fur Effect</title>
		<link>http://rmd.com.au/archives/papervision3d-grass-fur-effect</link>
		<comments>http://rmd.com.au/archives/papervision3d-grass-fur-effect#comments</comments>
		<pubDate>Mon, 23 Feb 2009 05:46:37 +0000</pubDate>
		<dc:creator>Rob Muller</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[fur]]></category>
		<category><![CDATA[grass]]></category>
		<category><![CDATA[Papervision3D]]></category>
		<category><![CDATA[Playstation2]]></category>

		<guid isPermaLink="false">http://rmd.com.au/?p=64</guid>
		<description><![CDATA[To me, &#8220;Shadow of the Colossus&#8221; represents the pinnacle of PlayStation 2 games. Aside from the fact that it&#8217;s one of the most artistic games I&#8217;ve ever played, it&#8217;s also one of the most technically brilliant games on the platform, pushing the PS2 to its limits with real-time motion blur, HDR rendering, a LOD landscape [...]]]></description>
			<content:encoded><![CDATA[<p>To me, &#8220;Shadow of the Colossus&#8221; represents the pinnacle of PlayStation 2 games. Aside from the fact that it&#8217;s one of the most artistic games I&#8217;ve ever played, it&#8217;s also one of the most technically brilliant games on the platform, pushing the PS2 to its limits with real-time motion blur, <a href="http://en.wikipedia.org/wiki/High_dynamic_range_rendering">HDR rendering</a>, a <a href="http://en.wikipedia.org/wiki/Level_of_detail_(programming)">LOD</a> landscape system, <a href="http://en.wikipedia.org/wiki/Inverse_kinematics">IK</a> &#038; physics system, self-shadowing and, of course, the impressive fur shading. However, the PS2 can&#8217;t handle all of those things done &#8220;properly&#8221;, so some were achieved with ingenious tricks and shortcuts, all covered in this inspiring article on <a href="http://edusworld.org/ew/ficheros/2006/paginasWeb/making_of_sotc.html">The Making of &#8220;Shadow of the Colossus&#8221;</a>.</p>
<p>Since reading that article I&#8217;ve always wanted to recreate the fur effect, and have now done so using Papervision3D. As I was hoping to use it on a recent project, instead of fur I decided to <a href="/labs/grass/">simulate grass</a>:</p>
<p><a href="/labs/grass/"><img src="/wp-content/uploads/2009/01/grass_effect.jpg" alt="Papervision Grass Effect" title="grass_effect" width="435" height="413" class="size-full wp-image-65" /></a></p>
<p>The effect is achieved by drawing cross-sections of the fur/grass on a set of parallel layers &#8211; in this case I have 7 layers which, using 512&#215;512 alpha-transparent textures with 4&#215;4 segments, is pushing the limits of Flash/PV3D. However, because we&#8217;re only ever dealing with 7 textures, it can handle potentially infinite blades of grass &#8211; the example above has 3000. The grass is generated in real-time &#8211; I build the layers up by starting each blade of grass with a certain size &#038; direction, and growing it out on subsequent layers. The effect looks fine when the camera is close to perpendicular or the normal of the planes, but things start to fall apart when the planes and camera approach parallel.</p>
<p>The grass highlights are created with simple gradients, and I&#8217;ve also rendered basic shadows to the dirt layer (although they&#8217;re barely noticeable with such dense grass). Each blade of grass has a random colour, weighted heavily towards green but straying towards blue/brown in rare cases. Creating the effect of the grass moving in the wind is a simple matter of moving each plane along the X &#038; Z axis, with the motion increasing based on the distance from the base layer.</p>
<p>Being a huge fan of both Ico and SOTC, I&#8217;m really looking forward to seeing the next game from Fumito Ueda and Team ICO, and what they can do with the PS3 hardware.</p>
]]></content:encoded>
			<wfw:commentRss>http://rmd.com.au/archives/papervision3d-grass-fur-effect/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

