<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:series="http://unfoldingneurons.com/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Activetuts+</title>
	
	<link>http://active.tutsplus.com</link>
	<description>Browser app and game development tutorials, from beginner to advanced</description>
	<lastBuildDate>Wed, 16 May 2012 21:00:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Flashtuts" /><feedburner:info uri="flashtuts" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><image><link>http://active.tutsplus.com</link><url>http://envato.s3.amazonaws.com/rss_images/activetuts.jpg</url><title>Activetuts+</title></image><feedburner:emailServiceId>Flashtuts</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Enable the Latest AIR SDK in Flash Professional CS5.5+</title>
		<link>http://feedproxy.google.com/~r/Flashtuts/~3/FVbu9JIOtho/</link>
		<comments>http://active.tutsplus.com/tutorials/workflow/enable-the-latest-air-sdk-in-flash-professional-cs5-5/#comments</comments>
		<pubDate>Wed, 16 May 2012 21:00:50 +0000</pubDate>
		<dc:creator>Daniel Albu</dc:creator>
				<category><![CDATA[Workflow]]></category>
		<category><![CDATA[AIR SDK]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[Flash Professional]]></category>
		<category><![CDATA[Stage3D]]></category>
		<guid isPermaLink="false">http://active.tutsplus.com/?p=11488</guid>
		<description>&lt;p&gt;New versions of the Adobe AIR SDK are often released between Flash Professional release cycles, using this tutorial, you&amp;#8217;ll be able to always use the latest Adobe AIR version in your IDE. This will allow you to enable Stage3D development within Flash Professional for both AIR and SWF projects.&lt;/p&gt;
&lt;p&gt;&lt;span id="more-11488"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Flash Professional CS5.5 Guide&lt;/h2&gt;
&lt;p&gt;(Flash Pro CS6 users, please &lt;a href="#cs6"&gt;skip to the next section&lt;/a&gt;.)&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 1:&lt;/span&gt; Download the Latest SDK&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Download the AIR 3.2 SDK from the following link: &lt;a href="http://www.adobe.com/products/air/sdk/"&gt;http://www.adobe.com/products/air/sdk/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Extract the downloaded file into a separate folder on your desktop&lt;/li&gt;
&lt;/ul&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 2:&lt;/span&gt; Backup Your Current SDK Folder&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Go to the Adobe Flash CS5.5 installation folder (should be &amp;#8220;C:\Program Files\Adobe\Adobe Flash CS5.5&amp;#8243; on 32 bit Windows, &amp;#8220;C:\Program Files (x86)\Adobe\Adobe Flash CS5.5&amp;#8243; on 64 bit Windows, and &amp;#8220;Applications/Adobe Flash CS5.5&amp;#8243; on OS X).&lt;/li&gt;
&lt;li&gt;Rename the &lt;code&gt;AIR2.6&lt;/code&gt; folder to &lt;code&gt;AIR2.6_OLD&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Create a new folder and name it &lt;code&gt;AIR2.6&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 3:&lt;/span&gt; Create the New SDK Folder&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Copy the contents of the &lt;code&gt;AIR 3.2 SDK&lt;/code&gt; folder (that you’ve created on your desktop) to the &lt;code&gt;AIR2.6&lt;/code&gt; folder.&lt;/li&gt;
&lt;li&gt;Browse to the &lt;code&gt;AIR2.6/frameworks/libs/air/&lt;/code&gt; folder in the Adobe Flash CS5.5 folder and copy the &lt;code&gt;airglobal.swc&lt;/code&gt; file.&lt;/li&gt;
&lt;li&gt;Paste the SWC file into &lt;code&gt;Adobe Flash CS5.5/Common/Configuration/ActionScript 3.0/AIR2.6/&lt;/code&gt;, overwriting the existing &lt;code&gt;airglobal.swc&lt;/code&gt; file.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 4:&lt;/span&gt; Final Configuration Settings&lt;/h2&gt;
&lt;p&gt;Go to &lt;code&gt;Adobe Flash CS5.5/Common/Configuration/Players/&lt;/code&gt; and open the following files using a text editor (you may need administrative privileges to edit these files in the application folder in Windows):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;AdobeAIR2_6.xml&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;AiriPhone.xml&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Android.xml&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Change the version attribute of the &lt;code&gt;player&lt;/code&gt; element from &lt;code&gt;11&lt;/code&gt; to &lt;code&gt;15&lt;/code&gt; in each file. Don’t forget to save them after you’re done editing. &lt;/p&gt;
&lt;hr /&gt;
&lt;a name="cs6"&gt;&lt;br /&gt;
&lt;h2&gt;Flash Professional CS6 Guide&lt;/h2&gt;
&lt;p&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;After years of not providing users with a more user-friendly way of upgrading the Adobe AIR SDK in Flash, Adobe finally added one to Flash Professional CS6.&lt;/p&gt;
&lt;p&gt;(Please note: since AIR 3.2 is already installed in Flash Professional CS6, we&amp;#8217;ll be using the AIR 3.3 Beta SDK in this section.)&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 1:&lt;/span&gt; Download the Latest Adobe AIR SDK &lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Download the latest SDK from the following link: &lt;a href="http://www.adobe.com/products/air/sdk/"&gt;http://www.adobe.com/products/air/sdk/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Please note: at the time of publishing the latest version was Adobe AIR 3.2 so we&amp;#8217;re using the Adobe AIR 3.3 Beta SDK (&lt;a href="http://labs.adobe.com/downloads/air3-3.html"&gt;http://labs.adobe.com/downloads/air3-3.html&lt;/a&gt;); after its official release this link won&amp;#8217;t work.&lt;/li&gt;
&lt;li&gt;Extract the downloaded file into a separate folder (e.g. &lt;code&gt;C:\AdobeAIR&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 2:&lt;/span&gt; Link the New SDK Folder to the Flash IDE&lt;/h2&gt;
&lt;p&gt;Go to the help menu and choose the &amp;#8216;Manage AIR SDK&amp;#8217; option&lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/tuts/440_airSDK/help.png" alt="CS6 Help Menu" /&gt;&lt;/div&gt;
&lt;p&gt;You&amp;#8217;ll notice a list of your currently installed Adobe SDK folders, the default one in CS6 is Adobe AIR 3.2&lt;/p&gt;
&lt;p&gt;Click the &lt;code&gt;+&lt;/code&gt; button to add a new folder.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/tuts/440_airSDK/plusButton.png" alt="Add a new SDK Folder" /&gt;&lt;/div&gt;
&lt;p&gt;Choose the new Adobe AIR SDK folder you created (in our example it was &lt;code&gt;C:\AdobeAIR&lt;/code&gt;).&lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/tuts/440_airSDK/chooseDirectory.png" alt="CS6 Choose Directory" /&gt;&lt;/div&gt;
&lt;p&gt;You&amp;#8217;ll notice that now we have the new SDK listed as well in our list.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/tuts/440_airSDK/newList.png" alt="New AIR SDK list" /&gt;&lt;/div&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 3:&lt;/span&gt; Publish&lt;/h2&gt;
&lt;p&gt;Now, in your Publish Settings you&amp;#8217;ll notice you have new options in additional to the old ones &lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/tuts/440_airSDK/newAIR.png" alt="New AIR SDK list" /&gt;&lt;/div&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;That’s it! From now on, content you target for AIR using your Flash Professional IDE will be exported using the latest Adobe AIR SDK. Thanks for reading!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/IrlDzey3U70IQ12p5ZSpH8slmNI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IrlDzey3U70IQ12p5ZSpH8slmNI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/IrlDzey3U70IQ12p5ZSpH8slmNI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IrlDzey3U70IQ12p5ZSpH8slmNI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=FVbu9JIOtho:tj7vwW9LHic:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=FVbu9JIOtho:tj7vwW9LHic:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=FVbu9JIOtho:tj7vwW9LHic:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=FVbu9JIOtho:tj7vwW9LHic:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=FVbu9JIOtho:tj7vwW9LHic:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=FVbu9JIOtho:tj7vwW9LHic:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=FVbu9JIOtho:tj7vwW9LHic:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=FVbu9JIOtho:tj7vwW9LHic:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=FVbu9JIOtho:tj7vwW9LHic:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=FVbu9JIOtho:tj7vwW9LHic:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Flashtuts/~4/FVbu9JIOtho" height="1" width="1"/&gt;</description>
		<wfw:commentRss>http://active.tutsplus.com/tutorials/workflow/enable-the-latest-air-sdk-in-flash-professional-cs5-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://active.tutsplus.com/tutorials/workflow/enable-the-latest-air-sdk-in-flash-professional-cs5-5/</feedburner:origLink></item>
		<item>
		<title>Quick Tip: Versioning Your Files With Dropbox (via Webdesigntuts+)</title>
		<link>http://feedproxy.google.com/~r/Flashtuts/~3/lycxICDoD2U/</link>
		<comments>http://active.tutsplus.com/articles/news/quick-tip-versioning-your-files-with-dropbox-via-webdesigntuts/#comments</comments>
		<pubDate>Tue, 15 May 2012 16:00:19 +0000</pubDate>
		<dc:creator>Michael James Williams</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[dropbox]]></category>
		<category><![CDATA[google drive]]></category>
		<category><![CDATA[version control]]></category>
		<category><![CDATA[workflow]]></category>
		<guid isPermaLink="false">http://active.tutsplus.com/?p=11475</guid>
		<description>&lt;p&gt;Ian Yates of &lt;a href="http://webdesign.tutsplus.com/"&gt;Webdesigntuts+&lt;/a&gt; has posted a great Quick Tip explaining how you can use Dropbox or Google Drive as a simple, automated version control system. It&amp;#8217;s worth checking out for web app and game developers too, so check it out below.&lt;/p&gt;
&lt;p&gt;&lt;span id="more-11475"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Having a version history of your graphics documents may save you from that awful moment when you realize you’ve scrubbed over a crucial stage of the design process. Thanks to Dropbox, you may already be storing versions of your work without even having noticed&amp;#8230; &lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Dropbox is like a time machine. It keeps snapshots of every change in your Dropbox folder over the last 30 days.&lt;/p&gt;&lt;/blockquote&gt;
&lt;hr /&gt;
&lt;h2&gt;Version History in the Cloud&lt;/h2&gt;
&lt;div class="tutorial_image"&gt;
&lt;iframe src="http://blip.tv/play/htB5gveTawA.html?p=1" width="600" height="369" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;embed type="application/x-shockwave-flash" src="http://a.blip.tv/api.swf#htB5gveTawA" style="display:none"&gt;&lt;/embed&gt;&lt;/p&gt;
&lt;p&gt;You can &lt;a href="http://d3pr5r64n04s3o.cloudfront.net/tuts/328_qt_dropbox/dropbox.mp4.zip" rel="external"&gt;download the video here&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Remember, both Dropbox and Google Drive will keep snapshots of your files for just 30 days, unless you upgrade your account. You can read more of what Google has to say on the matter at &lt;a href="http://support.google.com/drive/bin/answer.py?hl=en&amp;#038;answer=2409045" rel="external"&gt;support.google.com&lt;/a&gt;, or head on over to &lt;a href="https://www.dropbox.com/help/113" rel="external"&gt;Dropbox Help&lt;/a&gt; to read up on their &amp;#8220;Pack-Rat&amp;#8221; pro feature (which gives you indefinite history storage).&lt;/p&gt;
&lt;hr /&gt;
&lt;h3&gt;Useful Resources&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Sign up for &lt;a href="http://enva.to/IpgBqy" onclick="javascript:_gaq.push(['_trackEvent','outbound-article','enva.to']);"&gt;Dropbox&lt;/a&gt; if you haven&amp;#8217;t already!
&lt;li&gt;Sign up for &lt;a href="http://drive.google.com/" onclick="javascript:_gaq.push(['_trackEvent','outbound-article','drive.google.com']);"&gt;Google Drive&lt;/a&gt;
&lt;/ul&gt;
&lt;p&gt;And don&amp;#8217;t forget, you can view all the latest articles from across the Tuts+ network at the &lt;a href="http://hub.tutsplus.com/" rel="external"&gt;Tuts+ Hub&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/utrchnKO0CtYgpCRZp6ExE9NhAw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/utrchnKO0CtYgpCRZp6ExE9NhAw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/utrchnKO0CtYgpCRZp6ExE9NhAw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/utrchnKO0CtYgpCRZp6ExE9NhAw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=lycxICDoD2U:tV4lbcr6vQo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=lycxICDoD2U:tV4lbcr6vQo:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=lycxICDoD2U:tV4lbcr6vQo:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=lycxICDoD2U:tV4lbcr6vQo:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=lycxICDoD2U:tV4lbcr6vQo:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=lycxICDoD2U:tV4lbcr6vQo:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=lycxICDoD2U:tV4lbcr6vQo:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=lycxICDoD2U:tV4lbcr6vQo:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=lycxICDoD2U:tV4lbcr6vQo:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=lycxICDoD2U:tV4lbcr6vQo:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Flashtuts/~4/lycxICDoD2U" height="1" width="1"/&gt;</description>
		<wfw:commentRss>http://active.tutsplus.com/articles/news/quick-tip-versioning-your-files-with-dropbox-via-webdesigntuts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://active.tutsplus.com/articles/news/quick-tip-versioning-your-files-with-dropbox-via-webdesigntuts/</feedburner:origLink></item>
		<item>
		<title>Workshop: Nuclear Outrun – Critique</title>
		<link>http://feedproxy.google.com/~r/Flashtuts/~3/dPO0pft2XSk/</link>
		<comments>http://active.tutsplus.com/articles/critique/workshop-nuclear-outrun-critique/#comments</comments>
		<pubDate>Mon, 14 May 2012 16:30:01 +0000</pubDate>
		<dc:creator>Porter</dc:creator>
				<category><![CDATA[Critique]]></category>
		<category><![CDATA[Workshop]]></category>
		<category><![CDATA[critique]]></category>
		<category><![CDATA[game critique]]></category>
		<category><![CDATA[nuclear outrun]]></category>
		<category><![CDATA[workshop]]></category>
		<guid isPermaLink="false">http://active.tutsplus.com/?p=11471</guid>
		<description>&lt;p&gt;This week, Matt Porter critiques another recently released game: &lt;a href="http://www.kongregate.com/games/nerdook/nuclear-outrun" rel="external"&gt;Nuclear Outrun&lt;/a&gt;, developed by &lt;a href="https://www.facebook.com/pages/Nerdook-Productions/164269730266269" rel="external"&gt;Nerdook Productions&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;span id="more-11471"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Play the Game&lt;/h2&gt;
&lt;div class="tutorial_image"&gt;&lt;a href="http://www.kongregate.com/games/nerdook/nuclear-outrun" rel="external"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/100_nuclearOutrunCritique/export-from-game.jpg" alt="Nuclear Outrun Critique and Review" /&gt;&lt;/a&gt;
&lt;p&gt;Click to play Nuclear Outrun on Kongregate&lt;/p&gt;
&lt;/div&gt;
&lt;hr /&gt;
&lt;h2&gt;Overview&lt;/h2&gt;
&lt;p&gt;With 2012 moving along, it&amp;#8217;s no surprise that we&amp;#8217;re starting to see more and more &amp;#8220;end of the world&amp;#8221;-themed games. Nuclear Outrun is one such game, and while it&amp;#8217;s not perfect, it&amp;#8217;s quite enjoyable. It combines physics, zombies, distance, and upgrades, in a simple, yet enjoyable blend. With only one goal &amp;#8211; get to the goal before the nuke hits &amp;#8211; players really can&amp;#8217;t get too confused by what&amp;#8217;s going on. &lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Gameplay&lt;/h2&gt;
&lt;p&gt;As I mentioned above, your goal is simple: reach the goal before the nuke hits and turns you into a smear on the streets. You simply press forward (drive to the right), and shoot what gets in your way. You have 20 trucks (attempts), and with each attempt, you earn experience points which unlock new weapons and reward you with skill points. These skill points can be spent on upgrades, such as cranking up the power and ammunition of your weapons, making your vehicle more beastly, and so on.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/100_nuclearOutrunCritique/nuclear-outrun-04.png" alt="Nuclear Outrun Critique and Review" /&gt;&lt;/div&gt;
&lt;p&gt;Nuclear Outrun definitely repeats some of the mistakes common to the distance game formula, but it also succeeds where many others have failed. While you start off weak and slowly grow strong, you&amp;#8217;re not entirely crippled by your starting state. Many distance games start you off so weak, that you hardly play the game for the first ten minutes or so, but instead repeat the same simple run over and over, slowly gaining stat points. There is a certain degree of skill in Nuclear Outrun, and you can do well right off, which many other distance games sadly fail to allow. In fact, you can actually complete your goal without getting every upgrade, something most distance games don&amp;#8217;t allow. Doing so makes the game feel extremely linear, gives the player little satisfaction upon completion, and offers zero replay-value. I do wish skill was even more of a factor in Nuclear Outrun, but the leveling up aspect is simply part of the genre; at least it&amp;#8217;s a step in the right direction.&lt;/p&gt;
&lt;p&gt;While the game does use a physics engine, the controls do feel a bit off to me. For whatever reason, I found it far too common that the vehicle was tipped on its back. Even with the ability to adjust individual wheel sizes (such as a large wheel in back, small wheel in front), it was just too easy to end up with your front wheel raised to the sky. This leads to a decrease in the sense of speed (read: fun), and forces players to spend more time balancing their vehicle, rather than focusing on the more enjoyable aspects of the gameplay, such as shooting enemies.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/100_nuclearOutrunCritique/nuclear-outrun-06.png" alt="Nuclear Outrun Critique and Review" /&gt;&lt;/div&gt;
&lt;p&gt;What Nuclear Outrun does best is give the player complete freedom to choose how they want to play. You choose what weapon you want to use, how your vehicle handles (via wheel sizes), and what upgrades to put your skill points into. When you&amp;#8217;re actually in the game, it&amp;#8217;s up to you whether you want to fly forward full speed, or play it safe at a normal speed and take out all the obstacles.&lt;/p&gt;
&lt;p&gt;While we&amp;#8217;re on a positive note, it&amp;#8217;s also worth mentioning that Nuclear Outrun does a fantastic job of rewarding the player. Even after you complete the game, you get three new weapons, all of which are unique and fun. You&amp;#8217;re also rewarded with “Overtime” mode, which allows you to continue playing while competing for high scores. Nearly all web games, huge hits included, fail to reward players after the game is “completed”. It&amp;#8217;s extremely important that you give players something extra to reward them, as it increases replay value, and lets the player know you care. Simply saying “Congratulations!” on your final screen is insulting, and doesn&amp;#8217;t help you stand out.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Graphics&lt;/h2&gt;
&lt;p&gt;The graphics in Nuclear Outrun are pretty average. They have a simple yet effective style, but I personally find the whole package a bit unpolished, and lacking in detail. There&amp;#8217;s a lot of weapons and effects, so it&amp;#8217;s understandable that each one isn&amp;#8217;t in extreme detail, but there&amp;#8217;s definitely room for improvement. The animation is simple, but like the graphics, it&amp;#8217;s quite effective. Nothing really stands out as &lt;em&gt;poor&lt;/em&gt;; it&amp;#8217;s just nothing pretty.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/100_nuclearOutrunCritique/nuclear-outrun-03.png" alt="Nuclear Outrun Critique and Review" /&gt;&lt;/div&gt;
&lt;p&gt;The menus and UI in my opinion are a bit too messy. There&amp;#8217;s a lot of stray or unorganized text, which leads to confusion as to what information is where. The pre-game menu could be greatly improved by moving the level and high score elsewhere, and perhaps making it a bit smaller. All of the text is also just thrown on screen, and isn&amp;#8217;t placed with any artistic value. All in all, there&amp;#8217;s just too much text, with little thought into how it&amp;#8217;s displayed, and it looks messy.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/100_nuclearOutrunCritique/nucleer-outrun-02.png" alt="Nuclear Outrun Critique and Review" /&gt;&lt;/div&gt;
&lt;hr /&gt;
&lt;h2&gt;Audio&lt;/h2&gt;
&lt;p&gt;The audio in Nuclear Outrun is quite awesome. The main game doesn&amp;#8217;t have any music, but has a simple, but awesome ambient track. It definitely adds an apocalyptic feel to the game, and I think it fits better than music could have. The loop on the ambient track isn&amp;#8217;t perfect, which could be fixed with some minor tweaking, but it&amp;#8217;s not too noticeable during gameplay with all the sound effects going on in parallel.&lt;/p&gt;
&lt;p&gt;As far as the sound effects go, they&amp;#8217;re just as good. Dying is almost enjoyable, due to the sound of the nuke going off and the awesome scream that follows. All of the sounds appear to be unique to the game, which is always a plus. The sounds for zombies such as dying, upgrading, etc, are all very well done, and really couldn&amp;#8217;t be any better.&lt;/p&gt;
&lt;p&gt;Some of the interface buttons are inconsistent with playing a sound, and it would be a lot more professional if they all did. It&amp;#8217;s a minor fault to not have a simple sound play when pressing a button, but it really does take away from the full experience of a polished game.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/100_nuclearOutrunCritique/nuclear-outrun-05.png" alt="Nuclear Outrun Critique and Review" /&gt;&lt;/div&gt;
&lt;p&gt;All and all, Nuclear Outrun is a very well done physics, zombie, distance, and upgrade game. All of the above themes and genres are extremely popular with sponsors, so it&amp;#8217;s safe to assume that Nerdook didn&amp;#8217;t have a problem selling the game. While there&amp;#8217;s definitely room for improvement, I can&amp;#8217;t name any games that take the above genres and put them together any better, so kudos to Nerdook for that. &lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;Your Turn&lt;/h2&gt;
&lt;p&gt;What do you think of Nuclear Outrun? Leave your constructive criticism in the comments.&lt;/p&gt;
&lt;p&gt;And if you’ve got a browser game that you’d like the Activetuts+ community to do a critique on, &lt;a href="http://www.formstack.com/forms/envato-tuts_workshop"&gt;submit it here&lt;/a&gt;. We’re looking forward to seeing what you’ve made.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/z9hTm1dBycMO-TvVjLx7VnmvFE8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/z9hTm1dBycMO-TvVjLx7VnmvFE8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/z9hTm1dBycMO-TvVjLx7VnmvFE8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/z9hTm1dBycMO-TvVjLx7VnmvFE8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=dPO0pft2XSk:xeLLSPLFBX8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=dPO0pft2XSk:xeLLSPLFBX8:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=dPO0pft2XSk:xeLLSPLFBX8:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=dPO0pft2XSk:xeLLSPLFBX8:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=dPO0pft2XSk:xeLLSPLFBX8:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=dPO0pft2XSk:xeLLSPLFBX8:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=dPO0pft2XSk:xeLLSPLFBX8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=dPO0pft2XSk:xeLLSPLFBX8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=dPO0pft2XSk:xeLLSPLFBX8:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=dPO0pft2XSk:xeLLSPLFBX8:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Flashtuts/~4/dPO0pft2XSk" height="1" width="1"/&gt;</description>
		<wfw:commentRss>http://active.tutsplus.com/articles/critique/workshop-nuclear-outrun-critique/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<feedburner:origLink>http://active.tutsplus.com/articles/critique/workshop-nuclear-outrun-critique/</feedburner:origLink></item>
		<item>
		<title>Understanding Variables, Arrays, Loops, and Null: The Post-it Note Analogy</title>
		<link>http://feedproxy.google.com/~r/Flashtuts/~3/jaOXEmsFHi0/</link>
		<comments>http://active.tutsplus.com/articles/explanatory/understanding-variables-arrays-loops-and-null-the-repositional-note-analogy/#comments</comments>
		<pubDate>Fri, 11 May 2012 16:30:45 +0000</pubDate>
		<dc:creator>Michael James Williams</dc:creator>
				<category><![CDATA[Explanatory]]></category>
		<category><![CDATA[Basix]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[language agnostic]]></category>
		<category><![CDATA[platform-agnostic]]></category>
		<category><![CDATA[pointer]]></category>
		<category><![CDATA[reference]]></category>
		<category><![CDATA[value]]></category>
		<category><![CDATA[variable]]></category>
		<guid isPermaLink="false">http://active.tutsplus.com/?p=11453</guid>
		<description>&lt;p&gt;What does &lt;code&gt;var&lt;/code&gt; actually do, and why doesn&amp;#8217;t setting &lt;code&gt;myObject = null&lt;/code&gt; actually remove the object? These questions tie in to a fundamental concept in coding, relevant whether your language of choice is AS3, JavaScript, or C#, and can be understood using a few common items from the stationery cupboard.&lt;/p&gt;
&lt;p&gt;&lt;span id="more-11453"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;What&amp;#8217;s a Variable?&lt;/h2&gt;
&lt;p&gt;Let&amp;#8217;s start with the basics. Suppose you want to store the age of your friend Bill:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; collapse: false; first-line: 1; title: ; notranslate"&gt;
var ageOfBill:Number = 24;
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;(I&amp;#8217;m going to use AS3 for these example, but the basic concepts are the same in JavaScript and C#.&lt;/p&gt;
&lt;p&gt;In JavaScript, the syntax is almost the same, but we don&amp;#8217;t specify that age is a number:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: jscript; collapse: false; first-line: 1; title: ; notranslate"&gt;
var ageOfBill = 24;
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;In C# we don&amp;#8217;t use the &lt;code&gt;var&lt;/code&gt; keyword, but we do specify the type of the variable:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: csharp; collapse: false; first-line: 1; title: ; notranslate"&gt;
short ageOfBill = 24;
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;Not different enough to be confusing, I hope.)&lt;/p&gt;
&lt;p&gt;So what&amp;#8217;s happening here? Think of it this way:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;var&lt;/code&gt; (or &lt;code&gt;short&lt;/code&gt;, in C#) means, &amp;#8220;get a fresh Post-it note&amp;#8221;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ageOfBill&lt;/code&gt; means, &amp;#8220;write &lt;code&gt;ageOfBill&lt;/code&gt; across the top, in pen&amp;#8221;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;= 24&lt;/code&gt; means, &amp;#8220;write &lt;code&gt;24&lt;/code&gt; on the note, in pencil&amp;#8221;.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/099_repositionalNotes/1.png" alt="Understanding Variables, Arrays, Loops, and Null: The Post-it Note Analogy" /&gt;&lt;/div&gt;
&lt;p&gt;What if later we realise that Bill&amp;#8217;s actually younger than we thought?&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; collapse: false; first-line: 1; highlight: [3]; title: ; notranslate"&gt;
var ageOfBill = 24;
//...later...
ageOfBill = 20;
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;This just means we find our &lt;code&gt;ageOfBill&lt;/code&gt; note, erase &lt;code&gt;24&lt;/code&gt;, and write &lt;code&gt;20&lt;/code&gt; on it instead.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/099_repositionalNotes/2.png" alt="Understanding Variables, Arrays, Loops, and Null: The Post-it Note Analogy" /&gt;&lt;/div&gt;
&lt;p&gt;We &lt;em&gt;could&lt;/em&gt; write &lt;code&gt;var&lt;/code&gt; again:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; collapse: false; first-line: 1; title: ; notranslate"&gt;
var ageOfBill:Number = 24;
//...later...
var ageOfBill:Number = 20;
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;&amp;#8230;but this is not good code, because &lt;code&gt;var&lt;/code&gt; says, &amp;#8220;get a fresh Post-it note&amp;#8221;. If you do this, the compiler will usually figure out what you mean &amp;#8211; i.e. that you want to change what&amp;#8217;s written on the existing &lt;code&gt;ageOfBill&lt;/code&gt; Post-it note rather than actually getting a fresh one &amp;#8211; but it will probably complain.&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: plain; collapse: false; first-line: 1; title: ; notranslate"&gt;
Warning: #3596: Duplicate variable definition.
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;It depends on the language and on your coding environment.&lt;/p&gt;
&lt;p&gt;So can we ask the compiler to get a fresh Post-it note and write a label on it in pen, without writing anything on it in pencil? Perhaps we could do this for Bill&amp;#8217;s friend Marty, whose age we don&amp;#8217;t know:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; collapse: false; first-line: 1; title: ; notranslate"&gt;
var ageOfMarty:Number;
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;Actually (in AS3, at least) this will get a fresh Post-it note, write &lt;code&gt;ageOfMarty&lt;/code&gt; across the top, in pen&amp;#8230; and then write a default initial value of &lt;code&gt;0&lt;/code&gt; on there in pencil:&lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/099_repositionalNotes/3.png" alt="Understanding Variables, Arrays, Loops, and Null: The Post-it Note Analogy" /&gt;&lt;/div&gt;
&lt;p&gt;So, in other words, we can&amp;#8217;t have a Post-it note like this without it taking some value.&lt;/p&gt;
&lt;p&gt;Okay &amp;#8211; what about if we want to store the age of Bill&amp;#8217;s best friend Ted, who we know is the same age?&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; collapse: false; first-line: 1; title: ; notranslate"&gt;
var ageOfTed:Number = ageOfBill;
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;What happens here is, the computer looks at the &lt;code&gt;ageOfBill&lt;/code&gt; Post-it, then copies the number written on it in pencil to a fresh Post-it, on which it writes &lt;code&gt;ageOfTed&lt;/code&gt; across the top in pen.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/099_repositionalNotes/4.png" alt="Understanding Variables, Arrays, Loops, and Null: The Post-it Note Analogy" /&gt;&lt;/div&gt;
&lt;p&gt;This is just a copy, though; if we then change the value of &lt;code&gt;ageOfBill&lt;/code&gt; it won&amp;#8217;t affect &lt;code&gt;ageOfTed&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; collapse: false; first-line: 1; title: ; notranslate"&gt;
ageOfBill = 21;
&lt;/pre&gt;
&lt;/pre&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/099_repositionalNotes/5.png" alt="Understanding Variables, Arrays, Loops, and Null: The Post-it Note Analogy" /&gt;&lt;/div&gt;
&lt;p&gt;So! That&amp;#8217;s all pretty straightforward, and maybe even intuitive. Now let&amp;#8217;s talk about the first common pain point: arrays.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;What&amp;#8217;s an Array?&lt;/h2&gt;
&lt;p&gt;Think of an array as a ring binder.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/099_repositionalNotes/6.png" alt="Understanding Variables, Arrays, Loops, and Null: The Post-it Note Analogy" /&gt;&lt;/div&gt;
&lt;p&gt;(I was going to say a rolodex&amp;#8230;&lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/099_repositionalNotes/7.png" alt="Understanding Variables, Arrays, Loops, and Null: The Post-it Note Analogy" /&gt;&lt;/div&gt;
&lt;p&gt;&amp;#8230;but I realised that I had never even seen one in real life.)&lt;/p&gt;
&lt;p&gt;Each sheet inside the binder is like one of those Post-it notes, except without the pen-written label across the top. Instead, we refer to each sheet by the name of the binder and the page number of the sheet.&lt;/p&gt;
&lt;p&gt;Let&amp;#8217;s suppose we&amp;#8217;ve got an array of all our friends, in no particular order. Who&amp;#8217;s on the first page (page #0)?&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; collapse: false; first-line: 1; title: ; notranslate"&gt;
trace(friends[0]);
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;(&lt;code&gt;trace()&lt;/code&gt; just writes the line to the debug output; in JavaScript, you might use &lt;code&gt;console.log()&lt;/code&gt; and in C# you might use &lt;code&gt;Console.WriteLine()&lt;/code&gt; for the same purpose.)&lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/099_repositionalNotes/8.png" alt="Understanding Variables, Arrays, Loops, and Null: The Post-it Note Analogy" /&gt;&lt;/div&gt;
&lt;p&gt;It&amp;#8217;s Bill!&lt;/p&gt;
&lt;p&gt;So, now, what does the following line do?&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; collapse: false; first-line: 1; title: ; notranslate"&gt;
var firstFriend:String = friends[0];
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;It gets a fresh Post-it note (because of the &lt;code&gt;var&lt;/code&gt; keyword), writes &lt;code&gt;firstFriend&lt;/code&gt; across the top in pen, then copies whatever&amp;#8217;s written on the first page of the binder onto that note in pencil.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/099_repositionalNotes/9.png" alt="Understanding Variables, Arrays, Loops, and Null: The Post-it Note Analogy" /&gt;&lt;/div&gt;
&lt;p&gt;(Remember, &lt;code&gt;String&lt;/code&gt; just means a piece of text.)&lt;/p&gt;
&lt;p&gt;We can overwrite what&amp;#8217;s written on any page of the binder, just like with the Post-it notes:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; collapse: false; first-line: 1; title: ; notranslate"&gt;
friends[0] = &amp;quot;Kyle&amp;quot;;
&lt;/pre&gt;
&lt;/pre&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/099_repositionalNotes/10.png" alt="Understanding Variables, Arrays, Loops, and Null: The Post-it Note Analogy" /&gt;&lt;/div&gt;
&lt;p&gt;&amp;#8230;and of course this doesn&amp;#8217;t affect the &lt;code&gt;firstFriend&lt;/code&gt; Post-it.&lt;/p&gt;
&lt;p&gt;The binder is an apt analogy, because &amp;#8211; just like with an array &amp;#8211; you take take pages out, add new ones, and rearrange them. But remember, individual pages act just like the Post-it notes, except they don&amp;#8217;t have their own pen labels, just page numbers.&lt;/p&gt;
&lt;p&gt;Still pretty straightforward, I hope. So here&amp;#8217;s an interesting question: what happens when you do the following?&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; collapse: false; first-line: 1; title: ; notranslate"&gt;
var listOfNames:Array = friends;
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;Uh&amp;#8230;&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;You Can&amp;#8217;t Write That on a Post-it&lt;/h2&gt;
&lt;p&gt;I&amp;#8217;ve cheated a bit here, because I talked a bunch about arrays without ever explaining how we create one in the first place. So let&amp;#8217;s tackle that now.&lt;/p&gt;
&lt;p&gt;Suppose you type:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; collapse: false; first-line: 1; title: ; notranslate"&gt;
var friends:Array = [&amp;quot;Bill&amp;quot;, &amp;quot;Marty&amp;quot;, &amp;quot;Ted&amp;quot;];
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;&amp;#8230;What happens?&lt;/p&gt;
&lt;p&gt;Well, as usual, &lt;code&gt;var friends&lt;/code&gt; means we get a fresh Post-it note and write &lt;code&gt;friends&lt;/code&gt; across the top, in pen:&lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/099_repositionalNotes/11.png" alt="Understanding Variables, Arrays, Loops, and Null: The Post-it Note Analogy" /&gt;&lt;/div&gt;
&lt;p&gt;But what do we write on it in pencil? &lt;/p&gt;
&lt;p&gt;It&amp;#8217;s a trick question: we don&amp;#8217;t write &lt;em&gt;anything&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;See, &lt;code&gt;Array&lt;/code&gt; means, &amp;#8220;get a new ring binder&amp;#8221;. And &lt;code&gt;["Bill", "Marty", "Ted"]&lt;/code&gt; means &amp;#8220;put three pages in the binder, with these names on it&amp;#8221;:&lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/099_repositionalNotes/12.png" alt="Understanding Variables, Arrays, Loops, and Null: The Post-it Note Analogy" /&gt;&lt;br /&gt;You can&amp;#8217;t see the &amp;#8220;Marty&amp;#8221; and &amp;#8220;Ted&amp;#8221; pages, but they&amp;#8217;re totally there.&lt;/div&gt;
&lt;p&gt;And then? It&amp;#8217;s simple! We stick the &lt;code&gt;friends&lt;/code&gt; Post-it note to the cover of the binder:&lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/099_repositionalNotes/13.png" alt="Understanding Variables, Arrays, Loops, and Null: The Post-it Note Analogy" /&gt;&lt;/div&gt;
&lt;p&gt;Now, when we write:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; collapse: false; first-line: 1; title: ; notranslate"&gt;
trace(friends[0]);
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;&amp;#8230;we know that we have to find the Post-it labelled &lt;code&gt;friends&lt;/code&gt;, then look at whatever&amp;#8217;s written on the first page (page #0) of the binder that it&amp;#8217;s stuck to.&lt;/p&gt;
&lt;p&gt;There are actually very few types of variable where a value gets written onto a Post-it note in pencil. In AS3, the &lt;a href="http://help.adobe.com/en_US/as3/learn/WS5b3ccc516d4fbf351e63e3d118a9b90204-7f9c.html#WS5b3ccc516d4fbf351e63e3d118a9b90204-7f88"&gt;only such types&lt;/a&gt; (called &amp;#8220;primitives&amp;#8221;) are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Number&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;String&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;int&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;uint&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Boolean&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For everything else &amp;#8211; &lt;code&gt;Object&lt;/code&gt;, &lt;code&gt;MovieClip&lt;/code&gt;, &lt;code&gt;XML&lt;/code&gt;, and so on &amp;#8211; we stick the Post-it note onto the item itself.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/099_repositionalNotes/14.png" alt="Understanding Variables, Arrays, Loops, and Null: The Post-it Note Analogy" /&gt;&lt;/div&gt;
&lt;p&gt;(The details are a little different in JavaScript and C#, but overall the same idea applies.)&lt;/p&gt;
&lt;p&gt;So let&amp;#8217;s get back to our earlier question. When we type:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; collapse: false; first-line: 1; title: ; notranslate"&gt;
var listOfNames:Array = friends;
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;&amp;#8230;what happens?&lt;/p&gt;
&lt;p&gt;Again, we know that &lt;code&gt;var listOfNames&lt;/code&gt; means &amp;#8220;get a fresh Post-it note and write &lt;code&gt;listOfNames&lt;/code&gt; across the top in pen&amp;#8221;. And now we know that &lt;code&gt;Array&lt;/code&gt; means we&amp;#8217;ll be sticking the Post-it note to something (a binder), rather than writing something on the Post-it in pencil.&lt;/p&gt;
&lt;p&gt;Previously, when we&amp;#8217;ve done something similar, we&amp;#8217;ve copied the contents of one Post-it note onto another. So here, should we get a fresh new binder and copy all of the pages from the &lt;code&gt;friends&lt;/code&gt; binder into it?&lt;/p&gt;
&lt;p&gt;Actually, no! All we do is stick this new &lt;code&gt;listOfNames&lt;/code&gt; Post-it note onto the same binder as the &lt;code&gt;friends&lt;/code&gt; Post-it note.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/099_repositionalNotes/15.png" alt="Understanding Variables, Arrays, Loops, and Null: The Post-it Note Analogy" /&gt;&lt;/div&gt;
&lt;p&gt;Now, &lt;code&gt;friends&lt;/code&gt; and &lt;code&gt;listOfNames&lt;/code&gt; each refer to the &lt;em&gt;exact same array&lt;/em&gt;. So if we write:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; collapse: false; first-line: 1; title: ; notranslate"&gt;
listOfNames[0] = &amp;quot;Emmett&amp;quot;;
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;&amp;#8230;then &lt;code&gt;friends[0]&lt;/code&gt; will &lt;em&gt;also&lt;/em&gt; be &lt;code&gt;Emmett&lt;/code&gt;, because &lt;code&gt;listOfNames[0]&lt;/code&gt; and &lt;code&gt;friends[0]&lt;/code&gt; refer to the exact same page in the exact same binder! And because that page only contains a String (which is a &amp;#8220;primitive&amp;#8221; type, remember), then we&amp;#8217;ve just erased whatever was written on that page previously and written &lt;code&gt;Emmett&lt;/code&gt; there instead.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;So What Does &lt;code&gt;null&lt;/code&gt; Mean?&lt;/h2&gt;
&lt;p&gt;Seen like this, &lt;code&gt;null&lt;/code&gt; is quite easy to understand. This statement:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; collapse: false; first-line: 1; title: ; notranslate"&gt;
friends = null;
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;&amp;#8230;just means, &amp;#8220;remove the &lt;code&gt;friends&lt;/code&gt; Post-it note from whatever it&amp;#8217;s currently stuck to&amp;#8221;.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/099_repositionalNotes/16.png" alt="Understanding Variables, Arrays, Loops, and Null: The Post-it Note Analogy" /&gt;&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;friends&lt;/code&gt; Post-it still &lt;em&gt;exists&lt;/em&gt;, it&amp;#8217;s just not stuck to anything. So if you type:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; collapse: false; first-line: 1; title: ; notranslate"&gt;
trace(friends[0]);
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;or&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; collapse: false; first-line: 1; title: ; notranslate"&gt;
friends[0] = &amp;quot;Henry&amp;quot;;
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;&amp;#8230;then you&amp;#8217;ll get an error, because you&amp;#8217;re trying to reference the first page of the binder that the &lt;code&gt;friends&lt;/code&gt; Post-it is stuck to &amp;#8211; but it&amp;#8217;s not stuck to anything!&lt;/p&gt;
&lt;p&gt;So, to be clear, setting &lt;code&gt;friends = null&lt;/code&gt; doesn&amp;#8217;t affect the binder at all. You can still access it just fine via &lt;code&gt;listOfNames&lt;/code&gt;. And you can even type:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; collapse: false; first-line: 1; title: ; notranslate"&gt;
friends = listOfNames;
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;&amp;#8230;to go right back to the old situation:&lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/099_repositionalNotes/17.png" alt="Understanding Variables, Arrays, Loops, and Null: The Post-it Note Analogy" /&gt;&lt;/div&gt;
&lt;hr /&gt;
&lt;h2&gt;Garbage Collection&lt;/h2&gt;
&lt;p&gt;Like I said, setting &lt;code&gt;friends = null&lt;/code&gt; doesn&amp;#8217;t affect the binder directly, but it can have an &lt;em&gt;indirect&lt;/em&gt; effect.&lt;/p&gt;
&lt;p&gt;See, if there are no Post-it notes stuck to the binder at all, then there&amp;#8217;s no way for anyone to access the binder ever again. It&amp;#8217;ll just lie around, totally inaccessible. But having all these binders (and other objects) lying around, totally abandoned, is a real waste of space &amp;#8211; they&amp;#8217;re cluttering up the computer memory.&lt;/p&gt;
&lt;p&gt;That&amp;#8217;s where the &lt;em&gt;garbage collector&lt;/em&gt; comes in. This is a tool that periodically checks for any &amp;#8220;lost&amp;#8221; objects, and throws them in the trash &amp;#8211; and once they&amp;#8217;re gone, they&amp;#8217;re gone for good; if an array is garbage collected then all of its pages are, too.&lt;/p&gt;
&lt;p&gt;For most practical purposes, this doesn&amp;#8217;t affect you at all; objects only get garbage collected if they&amp;#8217;re lost and unable to be found by your code. If you have a lot of these lying around, then you might notice a slight lag every now and then, when the garbage collector does its job (it takes a little time to actively collect the garbage). The benefit is that this clears up more room (memory) for your app.&lt;/p&gt;
&lt;p&gt;(If you want to know more about this topic, read Daniel Sidhion&amp;#8217;s posts on &lt;a href="http://active.tutsplus.com/tutorials/workflow/quick-tip-understanding-garbage-collection-in-as3/"&gt;garbage collection&lt;/a&gt; and &lt;a href="http://active.tutsplus.com/tutorials/actionscript/keep-your-flash-projects-memory-usage-stable-with-object-pooling/"&gt;object pooling&lt;/a&gt;.)&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Arrays of Objects&lt;/h2&gt;
&lt;p&gt;Okay, there&amp;#8217;s one more big concept to grasp &amp;#8211; and it&amp;#8217;s the most complex one yet.&lt;/p&gt;
&lt;p&gt;Consider this snippet:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; collapse: false; first-line: 1; title: ; notranslate"&gt;
var firstFriendDetails:Array = [&amp;quot;Bill&amp;quot;, 20];
var secondFriendDetails:Array = [&amp;quot;Marty&amp;quot;, 16];
var thirdFriendDetails:Array = [&amp;quot;Ted&amp;quot;, 20];
var allFriends:Array = [firstFriendDetails, secondFriendDetails, thirdFriendDetails];
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;How the heck does &lt;em&gt;that&lt;/em&gt; work?&lt;/p&gt;
&lt;p&gt;Let&amp;#8217;s start with what we know. The first three lines are easy; for each one we:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Get a fresh binder.&lt;/li&gt;
&lt;li&gt;Insert a page with the friend&amp;#8217;s name written on it in pencil.&lt;/li&gt;
&lt;li&gt;For nsert another page with the friend&amp;#8217;s age written on it in pencil.&lt;/li&gt;
&lt;li&gt;Get a fresh Post-it and write the appropriate label across the top in pen.&lt;/li&gt;
&lt;li&gt;Stick the Post-it to the binder.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/099_repositionalNotes/18.png" alt="Understanding Variables, Arrays, Loops, and Null: The Post-it Note Analogy" /&gt;&lt;/div&gt;
&lt;p&gt;As for this line:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; collapse: false; first-line: 1; title: ; notranslate"&gt;
var allFriends:Array = [firstFriendDetails, secondFriendDetails, thirdFriendDetails];
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;&amp;#8230;we&amp;#8217;re going to need some string and some tape.&lt;/p&gt;
&lt;p&gt;We can think of that one line as being equivalent to this snippet:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; collapse: false; first-line: 1; title: ; notranslate"&gt;
var allFriends:Array = [];
allFriends[0] = firstFriendDetails;
allFriends[1] = secondFriendDetails;
allFriends[2] = thirdFriendDetails;
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;The first line is easy: get a fresh binder and a fresh Post-it note, write &lt;code&gt;allFriends&lt;/code&gt; on the Post-it note, and stick it to the binder.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/099_repositionalNotes/19.png" alt="Understanding Variables, Arrays, Loops, and Null: The Post-it Note Analogy" /&gt;&lt;/div&gt;
&lt;p&gt;As for the second line:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; collapse: false; first-line: 1; title: ; notranslate"&gt;
allFriends[0] = firstFriendDetails;
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;Remember that I said that each page in a binder is like a Post-it note, except without anything written in pen. If the first page was a Post-it, then we&amp;#8217;d simply stick it to the front of the &lt;code&gt;firstFriendDetails&lt;/code&gt; binder, right?&lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/099_repositionalNotes/20.png" alt="Understanding Variables, Arrays, Loops, and Null: The Post-it Note Analogy" /&gt;&lt;/div&gt;
&lt;p&gt;&amp;#8230;but it can&amp;#8217;t be both on the front of that binder &lt;em&gt;and&lt;/em&gt; inside the other binder. So, instead, we use string:&lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/099_repositionalNotes/21.png" alt="Understanding Variables, Arrays, Loops, and Null: The Post-it Note Analogy" /&gt;&lt;/div&gt;
&lt;p&gt;Same for the other two:&lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/099_repositionalNotes/22.png" alt="Understanding Variables, Arrays, Loops, and Null: The Post-it Note Analogy" /&gt;&lt;/div&gt;
&lt;p&gt;So when we want to know what &lt;code&gt;allFriends[2]&lt;/code&gt; refers to, we just open the &lt;code&gt;allFriends&lt;/code&gt; binder to that page and follow the string &amp;#8211; which, of course, leads to the &lt;code&gt;thirdFriendDetails&lt;/code&gt; binder.&lt;/p&gt;
&lt;p&gt;Similarly, for &lt;code&gt;allFriends[1][0]&lt;/code&gt;, we first figure out which binder &lt;code&gt;allFriends[1]&lt;/code&gt; refers to, and then we look at the first page of &lt;em&gt;that&lt;/em&gt; binder&amp;#8230; so &lt;code&gt;allFriends[1][0]&lt;/code&gt; is &lt;code&gt;Marty&lt;/code&gt;!&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Loops&lt;/h2&gt;
&lt;p&gt;Now put all that information together, and bear it in mind when reading this snippet:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; collapse: false; first-line: 1; title: ; notranslate"&gt;
var friends:Array = [&amp;quot;Bill&amp;quot;, &amp;quot;Marty&amp;quot;, &amp;quot;Ted&amp;quot;, &amp;quot;Emmett&amp;quot;, &amp;quot;Henry&amp;quot;];
var currentIndex:int = 0;
var currentFriend:String;

while (currentIndex &amp;lt; 5) {
    currentFriend = friends[currentIndex];
    trace(currentFriend);
}
var lastFriend:String = currentFriend;
trace(lastFriend);
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;What if we modify the value of &lt;code&gt;currentFriend&lt;/code&gt; inside the loop?&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; collapse: false; first-line: 1; highlight: [7,8,10]; title: ; notranslate"&gt;
var friends:Array = [&amp;quot;Bill&amp;quot;, &amp;quot;Marty&amp;quot;, &amp;quot;Ted&amp;quot;, &amp;quot;Emmett&amp;quot;, &amp;quot;Henry&amp;quot;];
var currentIndex:int = 0;
var currentFriend:String;

while (currentIndex &amp;lt; 5) {
    currentFriend = friends[currentIndex];
    currentFriend = &amp;quot;Herbert&amp;quot;;
    trace(currentFriend);
}
trace(friends[0]);
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;What if the array contains non-primitive objects (MovieClips, images, arrays, 3D objects, whatever)?&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; collapse: false; first-line: 1; title: ; notranslate"&gt;
var friends:Array = [firstFriend, secondFriend, thirdFriend, fourthFriend, fifthFriend];
var currentIndex:int = 0;
var currentFriend:MovieClip;   //or &amp;quot;:Image&amp;quot; or &amp;quot;:Object&amp;quot; or &amp;quot;:Array&amp;quot; or whatever

while (currentIndex &amp;lt; 5) {
    currentFriend = friends[currentIndex];
    currentFriend = sixthFriend;
}

//What is the value of friends[0] now?
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;Finally, what if the array contains other arrays, which themselves contain primitives?&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; collapse: false; first-line: 1; title: ; notranslate"&gt;
var firstFriendDetails:Array = [&amp;quot;Bill&amp;quot;, 20];
var secondFriendDetails:Array = [&amp;quot;Marty&amp;quot;, 16];
var thirdFriendDetails:Array = [&amp;quot;Ted&amp;quot;, 20];
var fourthFriendDetails:Array = [&amp;quot;Emmett&amp;quot;, 50];
var fifthFriendDetails:Array = [&amp;quot;Henry&amp;quot;, 36];
var friends:Array = [firstFriendDetails, secondFriendDetails, thirdFriendDetails, fourthFriendDetails, fifthFriendDetails];

var currentIndex:int = 0;
var currentFriend:Array;

while (currentIndex &amp;lt; 5) {
    currentFriend = friends[currentIndex];
    currentFriend[0] = &amp;quot;John&amp;quot;;
    currentFriend = [&amp;quot;Herbert&amp;quot;, 29];
}
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;What do you think the value of &lt;code&gt;friends[3][0]&lt;/code&gt; will be after that?&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Other Bits and Pieces&lt;/h2&gt;
&lt;p&gt;Here are a few other important notes you should know:&lt;/p&gt;
&lt;h3&gt;Objects&lt;/h3&gt;
&lt;p&gt;In AS3 and JavaScript, Objects are like Arrays except each page is referred to by a label rather than by its page number. So you can type:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; collapse: false; first-line: 1; title: ; notranslate"&gt;
var detailsOfBill:Object = {};  //&amp;quot;{}&amp;quot; means &amp;quot;create an Object&amp;quot;
detailsOfBill.title = &amp;quot;Esquire&amp;quot;;
detailsOfBill.bandName = &amp;quot;Wyld Stallyns&amp;quot;;
detailsOfBill.allNames = [&amp;quot;Bill&amp;quot;, &amp;quot;S.&amp;quot;, &amp;quot;Preston&amp;quot;];
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;&amp;#8230;and this is &lt;em&gt;kind of&lt;/em&gt; like getting a fresh binder, sticking a &lt;code&gt;detailsOfBill&lt;/code&gt; Post-it on the front, and filling it with three pages. The first page has the label &lt;code&gt;title&lt;/code&gt; written across the top in pen and the word &lt;code&gt;Esquire&lt;/code&gt; written on it in pencil; the second page has the label &lt;code&gt;bandName&lt;/code&gt; in pen and &lt;code&gt;Wyld Stallyns&lt;/code&gt; in pencil. The third page has the label &lt;code&gt;allNames&lt;/code&gt; but has nothing written on it in pencil; instead, a string attaches it to another, regular binder, whose pages are not labelled: the first page says &lt;code&gt;Bill&lt;/code&gt;, the second says &lt;code&gt;S.&lt;/code&gt;, and the third says &lt;code&gt;Preston&lt;/code&gt;, all in pencil.&lt;/p&gt;
&lt;p&gt;(To make things even more confusing, arrays are technically a special form of Object. And if you think that&amp;#8217;s bad, functions can be seen as a type of Object, too! But that&amp;#8217;s a topic for a future article&amp;#8230;)&lt;/p&gt;
&lt;h3&gt;More on Garbage Collection&lt;/h3&gt;
&lt;p&gt;I said that objects are garbage collected if they don&amp;#8217;t have any Post-it notes stuck to them, but this is an oversimplification. If one page of a binder points to an object via string (i.e. if &lt;code&gt;myArray[0] = myObject&lt;/code&gt; or similar), then that object won&amp;#8217;t be garbage collected. Same goes for if a page of a binder points to another binder (array), or if the page of an object binder points to another object binder&amp;#8230; and so on. It even applies if the only way to access the object is through a Post-it stuck to a binder which has one page that&amp;#8217;s tied to another binder, as many layers deep as you want to go.&lt;/p&gt;
&lt;p&gt;Basically, the garbage collector only collects an item if it can&amp;#8217;t be reached through any other variable.&lt;/p&gt;
&lt;p&gt;This explains why objects that are on the screen usually can&amp;#8217;t be object collected. In AS3, if a MovieClip or other type of DisplayObject is in the display list, then it&amp;#8217;s automatically added to what is essentially a hidden array of display objects (which you can access via &lt;a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/DisplayObjectContainer.html#getChildAt()"&gt;getChildAt()&lt;/a&gt;). Similar structures exist in JavaScript and C#. So if a graphic is on the screen, and you remove all references to it from variables, arrays, and objects, it still won&amp;#8217;t be garbage collected until you remove it from the display list.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Any Questions?&lt;/h2&gt;
&lt;p&gt;I hope this helps to clear things up. It&amp;#8217;s certainly a confusing concept when you first come across it: some variables actually contain a &lt;em&gt;value&lt;/em&gt;, while others just contain a &lt;em&gt;reference&lt;/em&gt; to an object. Don&amp;#8217;t worry if you&amp;#8217;re not 100% sure exactly what&amp;#8217;s going on; it&amp;#8217;ll make a lot more sense after a bit of practice (and a few mistakes!).&lt;/p&gt;
&lt;p&gt;However, if you have any specific questions about it, just stick a comment below and I&amp;#8217;ll do my best to answer.&lt;/p&gt;
&lt;p&gt;Thanks for reading!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/JqwL42Yu1v8yxXp4znDn5KZxWbs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JqwL42Yu1v8yxXp4znDn5KZxWbs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/JqwL42Yu1v8yxXp4znDn5KZxWbs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JqwL42Yu1v8yxXp4znDn5KZxWbs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=jaOXEmsFHi0:DQv_hqcBF6o:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=jaOXEmsFHi0:DQv_hqcBF6o:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=jaOXEmsFHi0:DQv_hqcBF6o:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=jaOXEmsFHi0:DQv_hqcBF6o:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=jaOXEmsFHi0:DQv_hqcBF6o:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=jaOXEmsFHi0:DQv_hqcBF6o:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=jaOXEmsFHi0:DQv_hqcBF6o:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=jaOXEmsFHi0:DQv_hqcBF6o:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=jaOXEmsFHi0:DQv_hqcBF6o:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=jaOXEmsFHi0:DQv_hqcBF6o:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Flashtuts/~4/jaOXEmsFHi0" height="1" width="1"/&gt;</description>
		<wfw:commentRss>http://active.tutsplus.com/articles/explanatory/understanding-variables-arrays-loops-and-null-the-repositional-note-analogy/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://active.tutsplus.com/articles/explanatory/understanding-variables-arrays-loops-and-null-the-repositional-note-analogy/</feedburner:origLink></item>
		<item>
		<title>Which Tuts+ Site Should We Launch Next?</title>
		<link>http://feedproxy.google.com/~r/Flashtuts/~3/70_neLKKldA/</link>
		<comments>http://active.tutsplus.com/articles/news/which-tuts-site-should-we-launch-next/#comments</comments>
		<pubDate>Thu, 10 May 2012 05:00:02 +0000</pubDate>
		<dc:creator>David Appleyard</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[launch]]></category>
		<category><![CDATA[poll]]></category>
		<category><![CDATA[tuts]]></category>
		<guid isPermaLink="false">http://active.tutsplus.com/?p=11442</guid>
		<description>&lt;p&gt;We&amp;#8217;re planning our next few Tuts+ sites, and would love your opinion and advice on which topics you think we should cover next! We&amp;#8217;d be really grateful if you could take a minute to answer our quick poll and share your thoughts&amp;#8230;&lt;/p&gt;
&lt;p&gt;&lt;span id="more-11442"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Have Your Say&lt;/h2&gt;
&lt;div style="float:right; margin:0 0 0 20px;"&gt;&lt;script type="text/javascript" charset="utf-8" src="http://static.polldaddy.com/p/6211906.js"&gt;&lt;/script&gt;&lt;br /&gt;
&lt;noscript&gt;&lt;a href="http://polldaddy.com/poll/6211906/"&gt;Activetuts+ Readers: Which Tuts+ Site Should We Launch Next?&lt;/a&gt;&lt;/noscript&gt;&lt;/div&gt;
&lt;p&gt;We&amp;#8217;ve been considering lots of different ideas for our next Tuts+ sites over the past few weeks, and wanted to also ask the opinion of our awesome community!&lt;/p&gt;
&lt;p&gt;A selection of different concepts are included in the poll to the right, along with the option for you to submit your own ideas as well.&lt;/p&gt;
&lt;p&gt;The important thing to note is that these are just ideas. Some of these are close to making our final cut, and others aren&amp;#8217;t&amp;#8230; We&amp;#8217;d love to hear what you think, to help guide our decision.&lt;/p&gt;
&lt;p&gt;Thanks for taking the time to offer your suggestion — I can&amp;#8217;t wait to see what you have to say!&lt;/p&gt;
&lt;h3&gt;Win a 6-Month Tuts+ Premium Membership&lt;/h3&gt;
&lt;p&gt;Our poll will be running for the next couple of weeks, and we&amp;#8217;ll be choosing one respondent at random to receive a six-month Tuts+ Premium membership!&lt;/p&gt;
&lt;p&gt;To be entered into the giveaway, just leave a comment on this post to go into a bit more detail about your site suggestion. We&amp;#8217;ll choose one comment at random to win the Tuts+ Premium membership when the poll ends.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Best of luck!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/M-Ttoas22JNauVvR8DQIvexvY4c/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/M-Ttoas22JNauVvR8DQIvexvY4c/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/M-Ttoas22JNauVvR8DQIvexvY4c/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/M-Ttoas22JNauVvR8DQIvexvY4c/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=70_neLKKldA:YKppUkTmMTM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=70_neLKKldA:YKppUkTmMTM:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=70_neLKKldA:YKppUkTmMTM:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=70_neLKKldA:YKppUkTmMTM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=70_neLKKldA:YKppUkTmMTM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=70_neLKKldA:YKppUkTmMTM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=70_neLKKldA:YKppUkTmMTM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=70_neLKKldA:YKppUkTmMTM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=70_neLKKldA:YKppUkTmMTM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=70_neLKKldA:YKppUkTmMTM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Flashtuts/~4/70_neLKKldA" height="1" width="1"/&gt;</description>
		<wfw:commentRss>http://active.tutsplus.com/articles/news/which-tuts-site-should-we-launch-next/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
		<feedburner:origLink>http://active.tutsplus.com/articles/news/which-tuts-site-should-we-launch-next/</feedburner:origLink></item>
		<item>
		<title>Create a Balloon Popping Game in Flash – Tuts+ Premium</title>
		<link>http://feedproxy.google.com/~r/Flashtuts/~3/LbGT02bc9x8/</link>
		<comments>http://active.tutsplus.com/tutorials/games/create-a-balloon-popping-game-in-flash-tuts-premium/#comments</comments>
		<pubDate>Wed, 09 May 2012 13:00:11 +0000</pubDate>
		<dc:creator>Carlos Yanez</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[bloons]]></category>
		<category><![CDATA[Box2D]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[gamedev]]></category>
		<category><![CDATA[Premium]]></category>
		<category><![CDATA[quickbox2d]]></category>
		<guid isPermaLink="false">http://active.tutsplus.com/?p=11446</guid>
		<description>&lt;p&gt;In this Premium tutorial, you&amp;#8217;ll learn to use a physics engine to power a Bloons-style Flash game, in which a squirrel throws acorns at a grid of balloons to try to pop as many as possible.&lt;span id="more-11446"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Premium Preview&lt;/h2&gt;
&lt;p&gt;Let&amp;#8217;s take a look at the result we will be working towards:&lt;/p&gt;
&lt;div class="tutorial_image"&gt;    &lt;object width="480" height="320"  		data="http://d2fhka9tf2vaj2.cloudfront.net/premium/072_balloons/Balloon.swf"  		type="application/x-shockwave-flash"&gt;&lt;param name="src" value="http://d2fhka9tf2vaj2.cloudfront.net/premium/072_balloons/Balloon.swf"&gt;&lt;/object&gt; &lt;/div&gt;
&lt;blockquote&gt;&lt;p&gt;One of the most popular Flash games ever is &lt;a href="http://ninjakiwi.com/Games/Bloons-Games/Bloons.html"&gt;Bloons&lt;/a&gt;, in which you play a monkey throwing darts to pop balloons. It&amp;#8217;s spawned numerous sequels, even branching out into other genres like tower defense. This tutorial will show you how to create your own balloon popping game, using the QuickBox2D engine.&lt;/p&gt;&lt;/blockquote&gt;
&lt;hr /&gt;
&lt;h2&gt;Read the Full Tutorial&lt;/h2&gt;
&lt;p&gt;Premium members can &lt;a href="http://tutsplus.com/tutorial/create-a-balloon-popping-game-in-flash/"&gt;access the full tutorial&lt;/a&gt; right away!&lt;/p&gt;
&lt;p&gt;If you&amp;#8217;re not yet a Premium member, you can still &lt;a href="http://tutsplus.com/tutorial/create-a-balloon-popping-game-in-flash/"&gt;read the first few steps for free&lt;/a&gt;.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Tuts+ Premium Membership&lt;/h2&gt;
&lt;p&gt;We run a Premium membership system which periodically gives members access to extra tutorials, like this one, from across the whole Tuts+ network. If you&amp;#8217;re a Premium member, you can &lt;a href="http://tutsplus.com/"&gt;log in and read the tutorial&lt;/a&gt;. If you&amp;#8217;re not a member, you can of course &lt;a href="http://tutsplus.com/join/"&gt;join today&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;Also, don&amp;#8217;t forget to follow &lt;a href="http://twitter.com/envatoactive"&gt;@envatoactive on twitter&lt;/a&gt;,  &lt;a href="https://plus.google.com/116404059866243074508"&gt;circle us on Google+&lt;/a&gt;, &lt;a href="http://facebook.com/activetuts"&gt;like us on Facebook&lt;/a&gt;, and grab the &lt;a href="http://feedproxy.google.com/flashtuts"&gt;Activetuts+ RSS Feed&lt;/a&gt; to stay up to date with the latest tutorials and articles.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Q-Q2gv11UoU_-VPPAojgHaz2x3s/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Q-Q2gv11UoU_-VPPAojgHaz2x3s/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Q-Q2gv11UoU_-VPPAojgHaz2x3s/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Q-Q2gv11UoU_-VPPAojgHaz2x3s/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=LbGT02bc9x8:-fbsTd-l-7U:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=LbGT02bc9x8:-fbsTd-l-7U:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=LbGT02bc9x8:-fbsTd-l-7U:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=LbGT02bc9x8:-fbsTd-l-7U:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=LbGT02bc9x8:-fbsTd-l-7U:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=LbGT02bc9x8:-fbsTd-l-7U:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=LbGT02bc9x8:-fbsTd-l-7U:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=LbGT02bc9x8:-fbsTd-l-7U:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=LbGT02bc9x8:-fbsTd-l-7U:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=LbGT02bc9x8:-fbsTd-l-7U:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Flashtuts/~4/LbGT02bc9x8" height="1" width="1"/&gt;</description>
		<wfw:commentRss>http://active.tutsplus.com/tutorials/games/create-a-balloon-popping-game-in-flash-tuts-premium/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://active.tutsplus.com/tutorials/games/create-a-balloon-popping-game-in-flash-tuts-premium/</feedburner:origLink></item>
		<item>
		<title>Flash’s Underrated “Graphic” Symbol</title>
		<link>http://feedproxy.google.com/~r/Flashtuts/~3/Pjdhko_dJ8M/</link>
		<comments>http://active.tutsplus.com/articles/general/flashs-underrated-graphic-symbol/#comments</comments>
		<pubDate>Tue, 08 May 2012 17:00:43 +0000</pubDate>
		<dc:creator>Anthony Lombardo</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[graphic]]></category>
		<category><![CDATA[symbols]]></category>
		<guid isPermaLink="false">http://active.tutsplus.com/?p=9964</guid>
		<description>&lt;p&gt;I can&amp;#8217;t tell you how many articles and tutorials I have come across on how to use symbols in Flash that immediately dismiss the graphic symbol as having no practical purpose, relegating it as just a step above grouping items. This article will attempt to dispel this myth by showing that the graphic symbol actually has some pretty cool and convenient features and knowing how and when to utilize them is a nice tool to have when you&amp;#8217;re creating animations in Flash.&lt;span id="more-9964"&gt;&lt;/span&gt; &lt;/p&gt;
October of 2011
&lt;p&gt;I first began using Flash with version MX. And through all the enhancements and added features in every release, one thing that has remained constant is the graphic symbol. But what has also remained constant, surprisingly enough, is how many Flash users don&amp;#8217;t know what the graphic symbol actually does. Somewhere along the line, this symbol has received a bad rap as being totally useless. If you&amp;#8217;ve ever wondered what exactly the purpose of the graphic symbol is and why the heck Adobe continues to keep it in Flash, this article is for you.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;The Basics&lt;/h2&gt;
&lt;p&gt;We&amp;#8217;ll start off with the most known and basic of things you can do with the graphic symbol that are inherent to all Flash symbols. Just like movie clips and buttons, a graphic symbol can have color effects applied to it like alpha and tint, get broken apart into its comprising elements via CMD/CTRL-B, and of course have its properties motion-tweened.&lt;/p&gt;
&lt;p&gt;I know that&amp;#8217;s far from a revelation, but I mention these attributes because I think it&amp;#8217;s important to keep in mind that a graphic symbol at its core is just like any other Flash symbol but with its own unique set of features. &lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;Animation Misconceptions&lt;/h2&gt;
&lt;p&gt;One of the biggest misconceptions about the graphic symbol is that it cannot contain animation &amp;#8211; or that, if it does, Flash will just ignore it at runtime. Not only is that completely untrue, but in actuality graphic symbols are very powerful and flexible when it comes to creating timeline animation.&lt;/p&gt;
&lt;p&gt;Just like a movie clip, a graphic symbol can contain nested animations on top of nested animations of other graphic symbols and movie clips. It is the symbol of choice used by most professional Flash animators, especially when it comes to creating complex timeline animation with lots of vector assets. Let&amp;#8217;s see why.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;Animation and the Properties Panel&lt;/h2&gt;
&lt;p&gt;The true power of the graphic symbol lies within the Properties panel. This is where you can control the animation inside a graphic symbol, which is one of the hidden, unknown jewels in Flash. The approach that I am about to detail is really an animation technique referred to by many as the &lt;a href="http://www.mudbubble.com/"&gt;Chris Georgenes&lt;/a&gt; method.&lt;/p&gt;
&lt;p&gt;If you&amp;#8217;re not familiar with Chris Georgenes, he is a well-respected Flash animator who innovated this approach to animating with graphic symbols and I was lucky enough to take a character animation course he was the instructor of. I highly recommend you read up on many of his Flash animation techniques and tricks.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/tuts/356_underratedGraphicsSymbol/assets/properties_panel.jpg" alt="graphic symbol properties panel" /&gt;&lt;/div&gt;
&lt;p&gt;That&amp;#8217;s enough background information so let&amp;#8217;s get cracking with the good stuff. When you create a graphic symbol (&lt;em&gt;Modify &gt; Convert to Symbol&lt;/em&gt;), you have three options for handling how the symbol will play back its animation; to see them, with the symbol selected, go over to the Properties panel and look under the Looping category.&lt;/p&gt;
&lt;p&gt;When you click on the Options drop-down, you will be presented with three options to choose from: Loop, Play Once and Single Frame. Also below the drop-down, you&amp;#8217;ll see a small input field labeled &amp;#8216;First&amp;#8217;. Before we get to that, let&amp;#8217;s understand the three looping options &amp;#8211; but keep that little input field in mind as we go through each option as it will all tie together.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; If you don&amp;#8217;t see the Options field, just click on the arrow to the left of Looping to reveal the drop-down.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/tuts/356_underratedGraphicsSymbol/assets/looping_options.jpg" alt="looping options of a graphic symbol" /&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Loop: &lt;/strong&gt;Loop is the default setting for every new graphic symbol that is created. Basically this option will constantly loop any and all animation that is nested inside it. So in other words, the symbol&amp;#8217;s timeline will play through its duration and then start over again, just like a movie clip. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Play Once:&lt;/strong&gt; This setting is pretty self-explanatory as well. It will play the symbol&amp;#8217;s timeline once through and then stop.  Think of it as the graphic symbol&amp;#8217;s way of adding a stop() action on the final frame of its timeline.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Single Frame:&lt;/strong&gt; Single frame allows you to display only a certain frame within the symbol&amp;#8217;s timeline. Whereas the symbol&amp;#8217;s timeline is actually playing when it&amp;#8217;s set to Loop or Play Once, the Single Frame option just jumps the timeline to a specific frame within the symbol and stays there.  I like to think of it as the graphic symbol&amp;#8217;s version of using &lt;code&gt;gotoAndStop(frame)&lt;/code&gt;. So how is this done? If you&amp;#8217;re recalling that tiny input field labeled &amp;#8216;First&amp;#8217; that I told you to keep in mind a few paragraphs back, you&amp;#8217;re heading in the right direction. &lt;/p&gt;
&lt;hr/&gt;
&lt;h3&gt;First Frame Input Field&lt;/h3&gt;
&lt;p&gt;Though very ambiguous and easily unnoticed, this input field is where all the fun happens for controlling the timeline of a given symbol. This is one of my favorite features of the graphic symbol because you can target a specific frame on the symbol&amp;#8217;s timeline by typing a frame number in the input field.&lt;/p&gt;
&lt;p&gt;When a graphic symbol is first created, the first frame input field is set to 1 by default &amp;#8211; as denoted by the 1 inside the field. This means frame 1 on the symbol&amp;#8217;s timeline will be the first frame the animation will begin on. That&amp;#8217;s where the label First comes in; think of it as the first frame you want to display or the first frame you want to play from. So if you have a symbol set to Single Frame and type 6 in the first frame field, it will display whatever is on frame 6. If the supplied frame number is blank or if the symbol doesn&amp;#8217;t even have that many frames in its timeline, then nothing will display.&lt;/p&gt;
&lt;p&gt;You can also use the first frame field with the Loop and Play Once options. If you set a symbol to Play Once and type in a certain frame number in the input field it will start from that frame. The same applies if you set it to loop. The symbol would begin to loop starting with the frame number you supplied in the input field. Keep in mind though that if you typed in 6, it will start to loop from frame 6 but once it reaches the end of the timeline it will continue to frame 1 in its usual manner. &lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;But It Still Isn&amp;#8217;t Animating&lt;/h2&gt;
&lt;p&gt;Now, if you took it upon yourself to try any of this out within Flash, you&amp;#8217;re probably wondering why your animation isn&amp;#8217;t playing in the manner I&amp;#8217;ve been describing. Open up the file named &lt;em&gt;looping_basics.fla&lt;/em&gt; in the source package. Double-click the graphic symbol that is on the stage to check out the animation that&amp;#8217;s inside of it. You&amp;#8217;ll see two layers spanning 239 frames on the timeline, with a new keyframe on both layers every 30 frames (i.e. every second). So if you scrub the play head, you&amp;#8217;ll see we basically have an 8-second animation in which on every second the number in the center increments by one and the circular background changes color. By all means nothing fancy.&lt;/p&gt;
&lt;p&gt;After you have the gist of the animation, return to the main timeline, click on the graphic symbol and check the properties panel to make sure the symbol is set to Loop and 1 in the first frame field. Now test out the movie.&lt;/p&gt;
&lt;p&gt;What&amp;#8217;s going on here? Our symbol isn&amp;#8217;t animating even though we have it set to Loop. Right about now you might want to say you told me so about Flash just ignoring a graphic symbol&amp;#8217;s animation. Before you do so, let&amp;#8217;s get to the bottom of this.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;It&amp;#8217;s All About the Timeline&lt;/h2&gt;
&lt;p&gt;This is the common pitfall most people experience when they create an animation inside a graphic symbol. And it&amp;#8217;s probably the reason why the symbol is thought of as useless. You create an animation on the graphic&amp;#8217;s timeline then position the symbol on the main timeline just like you would with a movie clip. But when you go to export your movie, the symbol just sits there static on the stage. This is where the misconception lies: we are expecting the graphic symbol to behave just like a movie clip.&lt;/p&gt;
&lt;p&gt;The trick to the graphic symbol is that it is &lt;em&gt;timeline driven&lt;/em&gt; &amp;#8211; meaning its own timeline coincides with the timeline the symbol is placed on. So if it&amp;#8217;s placed on the stage, it needs just as many frames on the main timeline as it has on its own timeline in order to play the animation in its entirety. In other words, whereas a movie clip will play independently of the timeline, a graphic symbol will be played only as far as its parent&amp;#8217;s timeline will allow it.&lt;/p&gt;
&lt;p&gt;In a nutshell, a graphic symbol needs frames.
&lt;div class="tutorial_image"&gt;  &lt;object width="600" height="350" data="http://d2fhka9tf2vaj2.cloudfront.net/tuts/356_underratedGraphicsSymbol/assets/timeline_video.swf" type="application/x-shockwave-flash"&gt;&lt;param name="src" value="http://d2fhka9tf2vaj2.cloudfront.net/tuts/356_underratedGraphicsSymbol/assets/timeline_video.swf" /&gt;&lt;/object&gt;  &lt;/div&gt;
&lt;h3&gt;Give It Some Frames&lt;/h3&gt;
&lt;p&gt;If you go back to our example in Flash, the reason our graphic symbol isn&amp;#8217;t playing is because there is only one frame on the main timeline.  So let&amp;#8217;s add some frames. Just for demonstration purposes, go to frame 30 and add frames. Now go to frame 60 and do the same. Do you see what&amp;#8217;s happening here? Then go to frame 90. Very cool, huh? Keep adding as many frames as you want and test the movie. You should see the animation begin to play, depending on how many frames you have on your main timeline. Remember our symbol has 239 frames on its timeline, so in order to see the entire animation, there needs to be the same amount on the main timeline.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Keep in mind this principal we&amp;#8217;ve been discussing doesn&amp;#8217;t just apply for the main timeline. The timeline that the graphic symbol is actually placed on will dictate its playback. So for example, if your graphic is inside a movie clip, you need frames on the movie clip&amp;#8217;s timeline to render the graphic&amp;#8217;s animation. Try it out yourself.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;  &lt;object width="600" height="350" data="http://d2fhka9tf2vaj2.cloudfront.net/tuts/356_underratedGraphicsSymbol/assets/playback_video.swf" type="application/x-shockwave-flash"&gt;&lt;param name="src" value="http://d2fhka9tf2vaj2.cloudfront.net/tuts/356_underratedGraphicsSymbol/assets/playback_video.swf" /&gt;&lt;/object&gt;  &lt;/div&gt;
&lt;h3&gt;Automatic Playback&lt;/h3&gt;
&lt;p&gt;As you probably noticed from the example file, you can actually see the graphic symbol animate as you scrub the timeline from the stage. Yes, very cool. This brings us to another unique feature that differentiates a graphic symbol from a movie clip and you&amp;#8217;ll probably find it to be its most useful. Since the graphic symbol is timeline driven, a benefit of that is having your animation automatically update within Flash. As long as you have ample amount of frames on the timeline where your symbol is located, you can always see your graphic symbol animate live. &lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;Case Study: Facial Expressions&lt;/h2&gt;
&lt;p&gt;Let&amp;#8217;s explore these techniques a little more to give you another look on how you can incorporate a graphic symbol into a project. Open up the file named &lt;em&gt;facial_expressions.fla&lt;/em&gt; that&amp;#8217;s in the source package. You will be greeted with a nice smiling face on the stage that was part of an illustration for an animated character I created a few years back. &lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/tuts/356_underratedGraphicsSymbol/assets/character.jpg" alt="character creation graphic symbols" /&gt;&lt;/div&gt;
&lt;p&gt;If you click on the symbol, you&amp;#8217;ll see it&amp;#8217;s a graphic with a library name of &lt;em&gt;expressions&lt;/em&gt;, and that it is set to Single Frame 1. Go inside the symbol and you&amp;#8217;ll see three layers: &lt;em&gt;eyes&lt;/em&gt;, &lt;em&gt;mouth&lt;/em&gt; and &lt;em&gt;head&lt;/em&gt;, each of which contain graphic symbols. The &lt;em&gt;head&lt;/em&gt; layer contains all the other elements that comprise this little guy&amp;#8217;s smiling face, and if you unlock the layer and double-click the symbol you&amp;#8217;ll see are all graphic symbols as well. For our purposes, though, we are going to be focusing on the graphic symbols for the mouth and eyes. Go inside the &lt;em&gt;mouth&lt;/em&gt; symbol and you&amp;#8217;ll see it contains various different mouth shapes at various points on the timeline, and the same goes for the eyes. Let me point out that the left and right eyes are instances of the same exact symbol.&lt;/p&gt;
&lt;p&gt;Go inside both the mouth and eye symbols and take a look around. You&amp;#8217;ll notice that I have a &lt;em&gt;frame labels&lt;/em&gt; layer corresponding to each facial expression and that I chose to put each of them on a keyframe that are 10 frames apart. There&amp;#8217;s no reason for having the timeline set up like this other than it&amp;#8217;s my own way of trying to keep it clean and organized. I probably wouldn&amp;#8217;t use the frame labels in ActionScript (though I could if I converted my graphic to a movie clip) but having a label for every new expression lets me know at a glance where a certain expression is on the timeline. And besides giving me some space so the labels can actually be read, the 10 frame gap between each keyframe simply makes it easy for me to remember where a new mouth or eye expression occurs on the timeline.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;  &lt;object width="600" height="350" data="http://d2fhka9tf2vaj2.cloudfront.net/tuts/356_underratedGraphicsSymbol/assets/facial_exp_video.swf" type="application/x-shockwave-flash"&gt;&lt;param name="src" value="http://d2fhka9tf2vaj2.cloudfront.net/tuts/356_underratedGraphicsSymbol/assets/facial_exp_video.swf" /&gt;&lt;/object&gt; &lt;/div&gt;
&lt;p&gt;Now jump back one level to the &lt;em&gt;expressions&lt;/em&gt; graphic where we just have our three layers of the mouth, eyes and head, and start using these symbols to create some animation. There&amp;#8217;s a lot of different ways you can set things up here, depending on what you want to do, but let&amp;#8217;s just keep it simple and make our guy blink.&lt;/p&gt;
&lt;p&gt;Insert a new frame on all three layers. Check that both the mouth and eye symbols are set to Single Frame 1 and then insert a new keyframe on the &lt;em&gt;eyes&lt;/em&gt; layer and set both eyes to Single Frame 10.&lt;/p&gt;
&lt;p&gt;Go back to the stage, give yourself about 45 or so frames, make a new keyframe on frame 30 and change the 1 in the &lt;em&gt;first frame&lt;/em&gt; field to a 2. Remember your keyframes should be set to Single Frame. Now test it out and your guy should be blinking. I know that&amp;#8217;s nothing fancy but the point here isn&amp;#8217;t so much about what can be created with the graphic symbol, but rather about the convenience and flexibility it provides you. We&amp;#8217;ll get to more on this in a bit but hopefully this example has your gears turning.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;  &lt;object width="600" height="350" data="http://d2fhka9tf2vaj2.cloudfront.net/tuts/356_underratedGraphicsSymbol/assets/blink_video.swf" type="application/x-shockwave-flash"&gt;&lt;param name="src" value="http://d2fhka9tf2vaj2.cloudfront.net/tuts/356_underratedGraphicsSymbol/assets/blink_video.swf" /&gt;&lt;/object&gt; &lt;/div&gt;
&lt;hr/&gt;
&lt;h2&gt;When Would You Use a Graphic Over a Movie Clip?&lt;/h2&gt;
&lt;p&gt;Personally, any time I am working on a project that calls for creating numerous timeline animations, I consider using the graphic symbol. Any Flash user who has ever spent countless hours tinkering with numerous movie clips that all contain their own animations has probably run into a situation where they wish they could pinpoint where something was occurring on a certain movie clip&amp;#8217;s timeline from another spot in the movie. From my own experience, there have been many times in which I have an animation inside one movie clip and want to use it within another clip but needed to know when a certain point in my animation was reached so I can have something else happen. I would have to resort to a tedious process of jumping back and forth between movie clips and counting frames so I could figure out where to place it on that second clip&amp;#8217;s timeline. Using my animation as a graphic would allow me to see everything without having to export my entire movie.   &lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/tuts/356_underratedGraphicsSymbol/assets/symbol_behavior.jpg" alt="properties panel movie clip graphic" /&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Tip:&lt;/strong&gt; Even when I am using a movie clip for a timeline animation, I sometimes temporarily set it as a graphic in the properties panel just so I can view the animation playback while other objects are animating around it. I can then get a better sense of the overall timing and do some tweaks; when I&amp;#8217;m done, I set it back to act as a movie clip.&lt;/p&gt;
&lt;p&gt;To do this, just click on your symbol, go to the top of the Properties panel and click on the drop down. This is where you can change your symbol&amp;#8217;s behavior on the fly, toggling it between a movie clip and a graphic.  This is very useful when you want to use the same symbol as both a movie clip and a graphic throughout your project. &lt;strong&gt;Note:&lt;/strong&gt; This technique will not work if you try to change between a movie clip and a button or between a graphic and a button.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;Practical Uses&lt;/h2&gt;
&lt;p&gt;Here are some other practical uses of when you might want to consider using a graphic symbol:  &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Animated Presentations:   &lt;/strong&gt;Presentations are the projects where I find myself using graphic symbols the most. Most flash presentations tend to be heavy on animation and syncing visuals to a script. The graphic symbol lends itself well to projects like these that are in linear in nature and have limited user interaction.  &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Syncing audio with an animation:   &lt;/strong&gt;This is an extension of the previous point. Anytime you want pinpoint synchronization between a sound and an animation, running your audio alongside your animated  graphic symbol will give you that type of control. Many voiceover presentations that I have been involved in have employed animated graphic symbols. &lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/tuts/356_underratedGraphicsSymbol/assets/flash_presentation.jpg" alt="flash presentation design" /&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Character animation:&lt;/strong&gt; Anytime you are going to create intricate animations with vector artwork that has lots of layers, the graphic symbol is the way to go. Many cartoon animations have been made with flash and I would bet anything that if you were to examine the FLA they were made in, the library would be packed to the brim with graphic symbols. Just like facial expressions, creating sequences for walk cycles and lip syncing sequences are ideal jobs for using the graphic symbol. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Creating multiple variations of a symbol:&lt;/strong&gt; We already touched on this notion throughout the article but I think it&amp;#8217;s worth further explanation. If you recall in our facial expressions example from earlier, the mouth and eye graphic were used to house all our different mouth and eye shapes for easy animating. Well, sometimes I use the graphic symbol to just hold a bunch of similar movie clips that are just slightly different, or what I like to refer to as poses.&lt;/p&gt;
&lt;p&gt;In some cases, I&amp;#8217;m not looking to sequence these poses for an animation like in the facial expressions example but to act as a holder of my elements, which will simplify the process of accessing them later on.  I find it much easier to refer to each pose if they are all on their own frame inside a graphic instead of having to sift through one long movie clip timeline with numerous layers. All I have to do is target the frame number of the one I want inside the first frame field like we did in the facial expressions example. And if I need to control any of my poses with actionscript, I just turn my graphic into a movie clip. &lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;Limitations&lt;/h2&gt;
&lt;p&gt;The graphic symbol is not without its limitations and drawbacks. While the graphic symbol can be very useful in certain situations, by no means am I advocating it as a replacement to the movie clip. In most situations, a movie clip will be your symbol of choice and will do just fine even for creating most timeline animations. Here are some things to keep in mind when using the graphic symbol:  &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Can&amp;#8217;t be controlled by ActionScript:&lt;/strong&gt; This is an obvious point but it&amp;#8217;s a biggie. Unlike a movie clip, you can&amp;#8217;t assign a graphic symbol an instance name and any script you place on its timeline will be ignored. Keep in mind though you can still use a movie clip that has ActionScript on its timeline as a graphic and it will play back normally. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Can&amp;#8217;t apply filters:&lt;/strong&gt; For some reason, Flash doesn&amp;#8217;t allow you to apply any of the filters or blending modes to a graphic symbol. To get around this, you can simply put your graphic symbol inside a movie clip and then apply the filter to the clip. &lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/tuts/356_underratedGraphicsSymbol/assets/classic_tween.jpg" alt="classic tweening graphic symbol" /&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Classic tweening graphic symbols with nested animation can be problematic:&lt;/strong&gt; This is one I learned the hard way and it&amp;#8217;s an issue that can happen quite easily without you even realizing. Let&amp;#8217;s say you have a graphic symbol with a pretty involved animation inside it, and you want to tween the symbol on the main timeline from left to right across the stage as your nested animation plays. You create your first keyframe on the timeline and you set it to Play Once starting on frame 1 in the Properties panel. When you create your second keyframe, Flash will automatically set it to Play Once and update the first frame field accordingly with the correct frame number in sequence.&lt;/p&gt;
&lt;p&gt;So using the above example if your first keyframe is on frame 10 on the main timeline and your next keyframe is on frame 40, the graphic symbol on this frame would be set to Play Once with the first frame field already set to 30. Get it? It inserted the frame number you left off from? Now if you were to add or delete frames within the tween, the symbol on that second keyframe will still have 30 set as its first frame to play from thus completely throwing off the order of your nested animation. It&amp;#8217;s just something to keep in mind; when you initially create keyframes, the first frame number will update correctly, but once you start moving keyframes up and down the timeline, things will get thrown off.  &lt;/p&gt;
&lt;p&gt;&lt;strong&gt; Note:&lt;/strong&gt; This only applies to classic tweens. If you are using the method for creating motion tweens that was introduced in Flash CS4, this won&amp;#8217;t be an issue.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Hopefully after reading this article you have a different opinion of the graphic symbol. Though it may not be something you can see yourself using all that frequently, the thing to keep in mind with the graphic symbol is that it&amp;#8217;s about knowing when to use it. As a developer, I don&amp;#8217;t use it all that often but I know I have it as an option if the situation calls for it. Like with most things in Flash, it comes down to a matter of personal preference. If you pick and choose your spots wisely, using the graphic symbol can be convenient and a time-saver. &lt;/p&gt;
&lt;p&gt;I know a lot was covered in this article, but the best way to really understand what the graphic symbol can do is to spend some time playing around with it in Flash. Change its looping options, target different frame numbers to start your animation on and toggle back and forth between using it as a graphic and a movie clip to really see what works and what doesn&amp;#8217;t. So maybe the next time you hit F8 and you are planning on creating a timeline animation, remember the graphic symbol might not be that useless after all.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/SgdMILhUbNSsxLukGfGyToZaUQU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/SgdMILhUbNSsxLukGfGyToZaUQU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/SgdMILhUbNSsxLukGfGyToZaUQU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/SgdMILhUbNSsxLukGfGyToZaUQU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=Pjdhko_dJ8M:ftfOmuX1rJE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=Pjdhko_dJ8M:ftfOmuX1rJE:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=Pjdhko_dJ8M:ftfOmuX1rJE:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=Pjdhko_dJ8M:ftfOmuX1rJE:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=Pjdhko_dJ8M:ftfOmuX1rJE:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=Pjdhko_dJ8M:ftfOmuX1rJE:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=Pjdhko_dJ8M:ftfOmuX1rJE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=Pjdhko_dJ8M:ftfOmuX1rJE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=Pjdhko_dJ8M:ftfOmuX1rJE:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=Pjdhko_dJ8M:ftfOmuX1rJE:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Flashtuts/~4/Pjdhko_dJ8M" height="1" width="1"/&gt;</description>
		<wfw:commentRss>http://active.tutsplus.com/articles/general/flashs-underrated-graphic-symbol/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		<feedburner:origLink>http://active.tutsplus.com/articles/general/flashs-underrated-graphic-symbol/</feedburner:origLink></item>
		<item>
		<title>Generating Ghosts That Follow in Your Footsteps</title>
		<link>http://feedproxy.google.com/~r/Flashtuts/~3/YOtKJybPr0Y/</link>
		<comments>http://active.tutsplus.com/tutorials/games/generating-ghosts-that-follow-in-your-footsteps/#comments</comments>
		<pubDate>Mon, 07 May 2012 12:00:36 +0000</pubDate>
		<dc:creator>Tyler Seitz</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[ai]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[gamedev]]></category>
		<category><![CDATA[ghost]]></category>
		<category><![CDATA[path following]]></category>
		<guid isPermaLink="false">http://active.tutsplus.com/?p=11414</guid>
		<description>&lt;p&gt;Path following is a simple concept to grasp: the object moves from point A to point B to point C, and so on. But what if we want our object to follow the path of the player, like ghosts in racing games? In this tutorial, I&amp;#8217;ll show you how to achieve this with waypoints in AS3.&lt;/p&gt;
&lt;p&gt;&lt;span id="more-11414"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;Final Result Preview&lt;/h2&gt;
&lt;div class="tutorial_image"&gt;
&lt;object width="480" height="320" data="http://d2fhka9tf2vaj2.cloudfront.net/tuts/439_ghostFollowing/preview.swf" type="application/x-shockwave-flash"&gt;&lt;param name="src" value="http://d2fhka9tf2vaj2.cloudfront.net/tuts/439_ghostFollowing/preview.swf" /&gt;&lt;/object&gt;
&lt;/div&gt;
&lt;p&gt;Click the SWF, then use the arrow keys to move around. Press space to switch to the ghost, which will follow the path you&amp;#8217;ve created.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;The Logic Behind Path Following&lt;/h2&gt;
&lt;p&gt;Let&amp;#8217;s suppose the player moves 4 units left and 2 units down from our point of origin. For our ghost to end up in the same location it will have to also move 4 units left and 2 units down from the same point of origin. Now let&amp;#8217;s say our player is moving at a speed of 2; for the path following to remain accurate our ghost will also have a speed rate of 2.&lt;/p&gt;
&lt;p&gt;What if our player decides to take a pause before continuing on? The obvious solution is for the ghost to keep track of the player&amp;#8217;s exact position every &lt;a href="http://active.tutsplus.com/tutorials/games/understanding-the-game-loop-basix/"&gt;tick&lt;/a&gt; &amp;#8211; but this will involve storing a lot of data. Instead, what we&amp;#8217;ll do is simply store data every time the player presses different &lt;em&gt;keys&lt;/em&gt; &amp;#8211; so if the player moves right for ten seconds, we&amp;#8217;ll store the same amount of data as if the player moved right for half a second.&lt;/p&gt;
&lt;p&gt;For this technique to work our ghost must abide by the following rules:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The ghost and player have the same point of origin.&lt;/li&gt;
&lt;li&gt;The ghost must follow the exact same path as the player.&lt;/li&gt;
&lt;li&gt;The ghost should move at the same speed as the player.&lt;/li&gt;
&lt;li&gt;The ghost has to store the current time each time the player&amp;#8217;s motion changes.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 1:&lt;/span&gt; Setting Up&lt;/h2&gt;
&lt;p&gt;Start by creating a new Flash file (ActionScript 3.0). Set the width to 480, the height to 320 and frames per second to 30. Leave the background color as white and save the file as &lt;code&gt;CreatingGhosts.fla&lt;/code&gt;; lastly &lt;a href="http://active.tutsplus.com/tutorials/actionscript/quick-tip-how-to-use-a-document-class-in-flash/"&gt;set its class&lt;/a&gt; to &lt;code&gt;CreatingGhosts&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Before we move into the classes we need to create a pair of MovieClips. Start by drawing two separate 20px squares without a stroke. Convert the first fill to a MovieClip, setting its registration to the center, naming it &lt;code&gt;player&lt;/code&gt; and exporting it for ActionScript with the class name &lt;code&gt;Player&lt;/code&gt;. Now repeat the same process, except replace the name with &lt;code&gt;ghost&lt;/code&gt; and the class with &lt;code&gt;Ghost&lt;/code&gt;. Remove these MovieClips from the stage.&lt;/p&gt;
&lt;p&gt;Create your document class with the following code:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
package{
	import flash.display.*;
	import flash.events.*;

	public class CreatingGhosts extends MovieClip{
		public var player:Player = new Player();
		public function CreatingGhosts(){
			addChild(player);
		}
	}
}
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;Self explanatory; our next step will be to set up the Player class:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
package{
	import flash.display.*;
	import flash.events.*;
	import flash.geom.Point;
	import flash.ui.Keyboard;
	import flash.utils.Timer;
	import flash.utils.getTimer;

	public class Player extends MovieClip{
		public var startPos:Point;
		public var startTime:int;
		public var speed:Number = 2;
		public var currentLife:int;
		public var keyPressLeft:Boolean = false;
		public var keyPressRight:Boolean = false;
		public var keyPressUp:Boolean = false;
		public var keyPressDown:Boolean = false;
		public function Player(){

		}
	}
}
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;The first three variables are used to help meet the rules; &lt;code&gt;startPos&lt;/code&gt; is our point of origin, &lt;code&gt;startTime&lt;/code&gt; is the time when the Player was added to the stage and &lt;code&gt;speed&lt;/code&gt; is our our rate of movement. &lt;code&gt;currentLife&lt;/code&gt; is an addition used to check how many times the player has died, accordingly each path is stored and obtainable through that value. The last four variables are used to check key presses.&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s time to create the &lt;code&gt;Ghost&lt;/code&gt; class:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
package{
	import flash.display.*;
	import flash.events.*;
	import flash.geom.Point;
	import flash.utils.getTimer;
	import flash.utils.Timer;

	public class Ghost extends MovieClip{
		static public var waypoints:Array = new Array();
		static public var times:Array = new Array();
		public var i:int = 0;
		public var startTime:int;
		public var speed:Number = 2;
		public var selectedLife:int;
		public function Ghost(){

		}
	}
}
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;The two static variables, &lt;code&gt;waypoints&lt;/code&gt; and &lt;code&gt;times&lt;/code&gt;, will be used to store arrays; the first will store coordinates of the player&amp;#8217;s positions whenever the player changes motion, and the second will store the times at which each change occurred. The other variables match those from the &lt;code&gt;Player&lt;/code&gt; class.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 2:&lt;/span&gt; Initializing the Player&lt;/h2&gt;
&lt;p&gt;Within the Player&amp;#8217;s constructor add the following line:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
addEventListener(Event.ADDED_TO_STAGE, init);
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;Next create the &lt;code&gt;init()&lt;/code&gt; function:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
public function init(e:Event){

}
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;First, we need to obtain the &lt;code&gt;startTime&lt;/code&gt; and push a new time array to the Ghost&amp;#8217;s &lt;code&gt;times&lt;/code&gt; array. (This is a little confusing; the ghost has multiple time arrays to allow it to deal with multiple lives in the future.)&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
startTime = flash.utils.getTimer();
Ghost.times.push(new Array);
currentLife = Ghost.times.length - 1;
Ghost.times[currentLife].push(flash.utils.getTimer() - startTime);
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;startTime&lt;/code&gt; is set to the current time (a value in milliseconds); we add a new child array to the Ghost&amp;#8217;s times array; our &lt;code&gt;currentLife&lt;/code&gt; is set to the index of this new array; and we push the time that has elapsed during this function to the first element of this new array.&lt;/p&gt;
&lt;p&gt;Now we set up the starting position:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
startPos = new Point(stage.stageWidth/2, stage.stageHeight/2);
this.x = startPos.x;
this.y = startPos.y;
Ghost.waypoints.push(new Array);
Ghost.waypoints[currentLife].push(startPos);
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;Our point of origin is set to the center of the stage; we reposition our Player to the origin; a new array is added to the &lt;code&gt;waypoints&lt;/code&gt; array in the Ghost class; and the first position is pushed to that array.&lt;/p&gt;
&lt;p&gt;So, at the moment, &lt;code&gt;Ghost.times[0][0]&lt;/code&gt; contains the number of milliseconds since the SWF was set up (practically zero), and &lt;code&gt;Ghost.waypoints[0][0]&lt;/code&gt; contains a Point set to the center of the stage.&lt;/p&gt;
&lt;p&gt;Our aim is to code this so that if, after one second, the player presses a key, then &lt;code&gt;Ghost.times[0][1]&lt;/code&gt; will be set to 1000, and &lt;code&gt;Ghost.waypoints[0][1]&lt;/code&gt; will be another Point, again set to the center (because the player will not have moved yet). When the player lets go of that key (or presses another), &lt;code&gt;Ghost.times[0][2]&lt;/code&gt; will be set to the current time, and &lt;code&gt;Ghost.waypoints[0][2]&lt;/code&gt; will be a Point that matches the player&amp;#8217;s position at that time.&lt;/p&gt;
&lt;p&gt;Now, here are the three event listeners:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
addEventListener(Event.ENTER_FRAME, enterFrame);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDown);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUp);
&lt;/pre&gt;
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 3:&lt;/span&gt; Key Events&lt;/h2&gt;
&lt;p&gt;For now let&amp;#8217;s ignore the enterFrame and focus on the key presses.&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
public function keyDown(e:KeyboardEvent){
	if (e.keyCode == Keyboard.LEFT &amp;amp;&amp;amp; keyPressLeft == false){
		updateWaypoints();
		keyPressLeft = true;
	}else if (e.keyCode == Keyboard.RIGHT  &amp;amp;&amp;amp; keyPressRight == false){
		updateWaypoints();
		keyPressRight = true;
	}

	if (e.keyCode == Keyboard.UP  &amp;amp;&amp;amp; keyPressUp == false){
		updateWaypoints();
		keyPressUp = true;
	}else if (e.keyCode == Keyboard.DOWN  &amp;amp;&amp;amp; keyPressDown == false){
		updateWaypoints();
		keyPressDown = true;
	}

	if (e.keyCode == Keyboard.SPACE){
		destroy();
	}
}
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;Just a few simple if-statements to prevent bugs in key presses, and two new functions that are being called. &lt;code&gt;updateWaypoints()&lt;/code&gt; will be called every time new points and times are to be pushed to the ghost arrays, and &lt;code&gt;destroy()&lt;/code&gt; is used to remove the Player and add the Ghost to the stage. But before we go to those functions let&amp;#8217;s finish off the key press functions.&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
public function keyUp(e:KeyboardEvent){
	if (e.keyCode == Keyboard.LEFT  &amp;amp;&amp;amp; keyPressLeft == true){
		updateWaypoints();
		keyPressLeft = false;
	}else if (e.keyCode == Keyboard.RIGHT  &amp;amp;&amp;amp; keyPressRight == true){
		updateWaypoints();
		keyPressRight = false;
	}

	if (e.keyCode == Keyboard.UP  &amp;amp;&amp;amp; keyPressUp == true){
		updateWaypoints();
		keyPressUp = false;
	}else if (e.keyCode == Keyboard.DOWN  &amp;amp;&amp;amp; keyPressDown == true){
		updateWaypoints();
		keyPressDown = false;
	}
}
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;This time we do the opposite: the variables are set to false when the key is released and the waypoints are updated.&lt;/p&gt;
&lt;p&gt;I will elaborate in more detail on what is happening between those functions. Each time you press a key the waypoints and times are updated, so if you press another to cause a change a point and its corresponding time are added to the ghost arrays. &lt;/p&gt;
&lt;p&gt;But what happens if the player decides to randomly release a key and cause change again? Well we account for that by updating the waypoints and times again. If this was not done the Ghost would not be able to account for 90 degree turns; instead it would move on an angle towards the next point.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 4:&lt;/span&gt; Updating and Destroying&lt;/h2&gt;
&lt;p&gt;Our &lt;code&gt;updateWaypoints()&lt;/code&gt; function is fairly simple, seeing as it consists of code that we have already written:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
public function updateWaypoints(){
	Ghost.times[currentLife].push(flash.utils.getTimer() - startTime);
	Ghost.waypoints[currentLife].push(new Point(this.x, this.y));
}
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;destroy()&lt;/code&gt; function is just as simple! Waypoints are updated, a Ghost is added, event listeners are stopped and our Player is removed:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
public function destroy(){
	updateWaypoints();
	var ghost:Ghost = new Ghost();
	parent.addChild(ghost);
	removeEventListener(Event.ENTER_FRAME, enterFrame);
	stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyDown);
	stage.removeEventListener(KeyboardEvent.KEY_UP, keyUp);
	parent.removeChild(this);
}
&lt;/pre&gt;
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 5:&lt;/span&gt; The Player&amp;#8217;s enterFrame&lt;/h2&gt;
&lt;p&gt;Begin by creating the function:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
public function enterFrame(e:Event){

}
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;For the purposes of this tutorial we will add some simple collision with borders, to show how the waypoints are updated on this change:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
if((this.x-(this.width/2)) &amp;gt; 0){

}
if((this.x+(this.width/2)) &amp;lt; stage.stageWidth){

}
if((this.y-(this.height/2)) &amp;gt; 0){

}
if((this.y+(this.height/2)) &amp;lt; stage.stageHeight){

}
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;Now are player should only move in the specified direction while it isn&amp;#8217;t touching a border. Inside the first if-statement add the following code for moving left:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
if(keyPressLeft == true){
	if((this.x-(this.width/2)) &amp;lt;= 0){
		updateWaypoints();
		this.x = this.width/2;
	}else{
		this.x -= speed;
	}
}
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;First we check if the left key is currently down, then we check to see if the Player&amp;#8217;s position is greater than or equal to 0; if so we update our waypoints and reposition the player to the edge of the left side; if not we continue to move the player left.&lt;/p&gt;
&lt;p&gt;The exact same thing is done for the other three sides:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
if(keyPressRight == true){
	if((this.x+(this.width/2)) &amp;gt;= stage.stageWidth){
		updateWaypoints();
		this.x = (stage.stageWidth - (this.width/2));
	}else{
		this.x += speed;
	}
}
&lt;/pre&gt;
&lt;/pre&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
if(keyPressUp == true){
	if((this.y-(this.height/2)) &amp;lt;= 0){
		updateWaypoints();
		this.y = this.height/2;
	}else{
		this.y -= speed;
	}
}
&lt;/pre&gt;
&lt;/pre&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
if(keyPressDown == true){
	if((this.y+(this.height/2)) &amp;gt;= stage.stageHeight){
		updateWaypoints();
		this.y = (stage.stageHeight - (this.height/2));
	}else{
		this.y += speed;
	}
}
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;And with that we are finished with the Player Class!&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 6:&lt;/span&gt; Initializing the Ghost&lt;/h2&gt;
&lt;p&gt;Add the following line inside the Ghost&amp;#8217;s constructor:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
addEventListener(Event.ADDED_TO_STAGE, init);
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;Like before create the &lt;code&gt;init()&lt;/code&gt; function:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
public function init(e:Event){
	selectedLife = times.length - 1;
	this.x = waypoints[selectedLife][0].x;
	this.y = waypoints[selectedLife][0].y;
	startTime = flash.utils.getTimer();
	addEventListener(Event.ENTER_FRAME, enterFrame);
}
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;We start by selecting the path we want to use (by default it will choose the last array); we then position the ghost to the origin and set our Ghost&amp;#8217;s start time. Then an event listener for the enterFrame is created.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 7:&lt;/span&gt; The Ghost&amp;#8217;s enterFrame&lt;/h2&gt;
&lt;p&gt;Naturally we create our enterFrame function:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
public function enterFrame(e:Event){

}
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;Now we have to loop through our time array. We do this through the variable &lt;code&gt;i&lt;/code&gt;; we check if it is less than the length of the array and we also check if the time elapsed is greater than or equal to the current time in the array:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
while (i &amp;lt; times[selectedLife].length - 1 &amp;amp;&amp;amp; flash.utils.getTimer() - startTime &amp;gt;= times[selectedLife][i]) {
	i++;
}
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;The next thing to do is to move the Ghost if the time elapsed is less than the current time from the array:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
if (flash.utils.getTimer() - startTime &amp;lt; times[selectedLife][i]) {
	updatePosition();
}
&lt;/pre&gt;
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 8:&lt;/span&gt; Updating the Ghost&amp;#8217;s Position&lt;/h2&gt;
&lt;p&gt;We&amp;#8217;ll start this step off by creating the &lt;code&gt;updatePosition()&lt;/code&gt; function:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
public function updatePosition(){

}
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;Next add two variables, to represent the difference and the distance between the old and the new position:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
var diff:Point = waypoints[selectedLife][i].subtract(new Point(this.x, this.y));
var dist = diff.length;
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;We subtract the points from each other to find the distance. Now, we must move the ghost:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
if (dist &amp;lt;= speed){
	this.x = waypoints[selectedLife][i].x;
	this.y = waypoints[selectedLife][i].y;
}else{
	diff.normalize(1);
	this.x += diff.x * speed;
	this.y += diff.y * speed;
}
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;First we check whether the distance is less than the speed (i.e. the distance the ghost moves each tick); if so we move the Ghost directly to the point. However, if the distance is less then we normalize the difference (&amp;#8220;means making its magnitude be equal to 1, while still preserving the direction and sense of the vector&amp;#8221; &amp;#8211; &lt;a href="http://active.tutsplus.com/tutorials/actionscript/euclidean-vectors-in-flash/"&gt;Euclidean Vectors in Flash&lt;/a&gt;), and we increase the Ghost&amp;#8217;s position along the direction of the point.&lt;/p&gt;
&lt;p&gt;&lt;!--more--&gt;&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 9:&lt;/span&gt; A Side Note&lt;/h2&gt;
&lt;p&gt;Something to note about this method is that it uses a lot of CPU resources to continuously load times and points, and at times can produce some lag even though the logic is correct. We found two ways of countering this, though! &lt;/p&gt;
&lt;p&gt;The first is setting your SWF to be uncompressed in the Publish Settings; this will result in a longer load time at start up however the performance will be smoother. The second is more preferable if you plan on compiling your project as an exe for offline use: simply increase the frame rate to something around 60.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;Conclusion:&lt;/h2&gt;
&lt;p&gt;Thank you for taking the time to read this tutorial! If you have any questions or comment please leave them below. And if you want an extra challenge try setting up the Ghost class to follow the paths in reverse, or in slow motion.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/PoikaCe4qNJ8ampwyHy7BH3xq_k/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PoikaCe4qNJ8ampwyHy7BH3xq_k/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/PoikaCe4qNJ8ampwyHy7BH3xq_k/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PoikaCe4qNJ8ampwyHy7BH3xq_k/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=YOtKJybPr0Y:mhOqGsgHbhk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=YOtKJybPr0Y:mhOqGsgHbhk:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=YOtKJybPr0Y:mhOqGsgHbhk:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=YOtKJybPr0Y:mhOqGsgHbhk:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=YOtKJybPr0Y:mhOqGsgHbhk:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=YOtKJybPr0Y:mhOqGsgHbhk:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=YOtKJybPr0Y:mhOqGsgHbhk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=YOtKJybPr0Y:mhOqGsgHbhk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=YOtKJybPr0Y:mhOqGsgHbhk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=YOtKJybPr0Y:mhOqGsgHbhk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Flashtuts/~4/YOtKJybPr0Y" height="1" width="1"/&gt;</description>
		<wfw:commentRss>http://active.tutsplus.com/tutorials/games/generating-ghosts-that-follow-in-your-footsteps/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://active.tutsplus.com/tutorials/games/generating-ghosts-that-follow-in-your-footsteps/</feedburner:origLink></item>
		<item>
		<title>Workshop: Utopian Mining – Critique</title>
		<link>http://feedproxy.google.com/~r/Flashtuts/~3/oCIVhWuG_8c/</link>
		<comments>http://active.tutsplus.com/articles/critique/workshop-utopian-mining-critique/#comments</comments>
		<pubDate>Sat, 05 May 2012 15:00:05 +0000</pubDate>
		<dc:creator>Porter</dc:creator>
				<category><![CDATA[Critique]]></category>
		<category><![CDATA[Workshop]]></category>
		<category><![CDATA[critique]]></category>
		<category><![CDATA[game critique]]></category>
		<category><![CDATA[tuts-workshop]]></category>
		<category><![CDATA[utopian mining]]></category>
		<category><![CDATA[workshop]]></category>
		<guid isPermaLink="false">http://active.tutsplus.com/?p=11409</guid>
		<description>&lt;p&gt;Today, Matt Porter takes a look at a recently released mining game, currently doing very well on Newgrounds: &lt;a href="http://www.newgrounds.com/portal/view/593832" rel="external"&gt;Utopian Mining&lt;/a&gt;, developed by &lt;a href="http://schulles.newgrounds.com/" rel="external"&gt;Schulles&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;span id="more-11409"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Play the Game&lt;/h2&gt;
&lt;div class="tutorial_image"&gt;&lt;a href="http://www.newgrounds.com/portal/view/593832" rel="external"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/098_utopiaMiningCritique/utopia-mining-07.png" /&gt;&lt;/a&gt;&lt;br /&gt;Click to play on Newgrounds&lt;/div&gt;
&lt;hr /&gt;
&lt;h2&gt;Overview&lt;/h2&gt;
&lt;p&gt;Utopian Mining is one of the most polished RPG digging games I&amp;#8217;ve played on the web in some time. It does so much right that it stings horribly when you do come across its few faults. My expectations were set high after seeing the excellent scores on Newgrounds and playing for a few moments, but I quickly learned that the game wasn&amp;#8217;t all my hopes had wanted it to be. &lt;/p&gt;
&lt;p&gt;My high expectations aside, there&amp;#8217;s a lot to be learned from this wonderful little (emphasis on little) game.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Gameplay&lt;/h2&gt;
&lt;p&gt;The object is simple. You&amp;#8217;re a tiny mining robot hanging out in a town that was recently destroyed by a horrible storm, and you need to collect materials while digging to get the town up and running again. There&amp;#8217;s been a decent number of games in this genre over the years, and they&amp;#8217;ve always done quite well in the eyes of players; quite well for sponsors too seeing as they continue to get sponsored by large sites such as Newgrounds and Kongregate. There&amp;#8217;s definitely some concrete evidence as to why they do so well, which I&amp;#8217;ll go over shortly.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/098_utopiaMiningCritique/utopia-mining-01.png" /&gt;&lt;/div&gt;
&lt;p&gt;Utopian Mining doesn&amp;#8217;t really mix things up too much from your standard RPG digger, but it does add a few (extremely linear) quests, as well as a bit of story. Quests generally consist of giving someone money or a certain material, all of which is laid out in the exact order you would achieve if said quests didn&amp;#8217;t exist, making the quests more of an illusion than anything. &lt;/p&gt;
&lt;p&gt;The game appears to be a lot more content filled at first, especially when new buildings rise as you complete quests, and you learn of a beach far to the east, but it quickly becomes apparent that these changes hardly affect gameplay and are mostly visual fluff. Buildings give a small discount in restoring power to your robot, and the beach is used to get sand for a quest just once (yes, once). This visual fluff is of course a welcome addition, especially in the eyes of sponsors, but I fear that these quests will quickly feel shallow to the average player, leaving them with a desire for just a bit more depth. I would have loved to see quests be less linear, and to have them alter how the game is actually played. Unlocking new upgrades in the shop would have been great incentive to complete a difficult, and not immediately rewarding quest. In addition to these faults, the player also isn&amp;#8217;t alerted when a quest is complete, which seems like a no-brainer for an otherwise very polished game.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/098_utopiaMiningCritique/utopia-mining-05.png" /&gt;&lt;br /&gt;The beach&lt;/div&gt;
&lt;p&gt;The largest flaw of the game is that it&amp;#8217;s so simple it becomes ridiculously easy to complete. It&amp;#8217;s so unbalanced, that if it wasn&amp;#8217;t short, slightly addicting, and quite charming, it would likely fail to be a decent game. Many players, such as myself, often skip cheap upgrades, and save up for the next reasonable purchase. This may take an extra five or ten minutes to do early on in the game, but it generally pays off. The same is true for buying equipment in games such as Final Fantasy, or really any game that offers an upgrade system of some sort. &lt;/p&gt;
&lt;p&gt;The problem with Utopian Mining, is that it doesn&amp;#8217;t only pay off &amp;#8211; it actually destroys whatever challenge may have ever existed. I beat the entire game within an hour, and wasn&amp;#8217;t remotely challenged beyond the first five minutes; in fact, my robot never even died. Generally speaking, the challenge of a game should increase as you go on, but Utopian Mining simply gets easy, whether you skip upgrades or not. Schulles (the developer) simply didn&amp;#8217;t pay enough attention to the balance of the game, and it unfortunately reared it&amp;#8217;s ugly head for me, and from the looks of other reviews, many other players. &lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/098_utopiaMiningCritique/utopia-mining-06.png" /&gt;Close to death, but never in any real danger.&lt;/div&gt;
&lt;p&gt;While casual gaming is fun, it&amp;#8217;s important to challenge players, or at least make them feel like they completed something difficult, even if “difficult” simply translates to time consumption (a common tactic of MMORPGs). While I don&amp;#8217;t want to write out a game design document in this review, a simple addition to make the game more challenging would have been more hazards, such as lava pits. As it is, going deeper and running out of energy are the only things that can kill you, and that obviously doesn&amp;#8217;t really work.&lt;/p&gt;
&lt;p&gt;One of the more minor flaws, in my opinion, is the rather clunky user interface. For an example, let&amp;#8217;s look at the shop screen: &lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/098_utopiaMiningCritique/utopia-mining-08.png" /&gt;&lt;/div&gt;
&lt;p&gt;To navigate the shop, you must press 1-4 to switch between categories (chassis, drill, batter, cooling liquid), use the arrow keys to go up and down, X to select, and C to exit. I love retro games, and I&amp;#8217;m all about ditching the mouse when it really isn&amp;#8217;t needed, but this wasn&amp;#8217;t one of those times. There&amp;#8217;s no reason to neglect the mouse for a simple shopping interface, especially when it would be faster and less frustrating to use for the player, and could work alongside keyboard controls as well. There&amp;#8217;s no reason to annoy your players because you feel like being truly retro; give players an option, and both casual and hardcore players will be happy.&lt;/p&gt;
&lt;p&gt;While Utopian Mining has its flaws, as almost all games do, it does a lot right. It takes everything you&amp;#8217;d expect from an RPG digging game, strips it down, and polishes what little it has to an extreme. It&amp;#8217;s basic, but it&amp;#8217;s addicting, and for any game developer, that&amp;#8217;s a good thing. Getting players to return to your game is not only great for increasing views, but it also helps developers gain more recognition, and both sponsors and developers will earn a decent bit more revenue, assuming the developer put ads such as Mochi or CPMstar in their game. &lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/098_utopiaMiningCritique/utopia-mining-04.png" /&gt;&lt;/div&gt;
&lt;p&gt;The unfortunate side to this, for Utopian Mining, is that the game isn&amp;#8217;t quite long enough to ensure a returning play from most players, as it&amp;#8217;s generally beaten in the first sitting. As far as the core mechanics go, they&amp;#8217;re addicting. The game lacks any sort of real depth (aside from the digging bit &lt;em&gt;[that was a terrible pun - Ed.]&lt;/em&gt;), but that aside, players seem to get addicted, and want more. The core mechanics of the game are undeniably an extremely strong point, and seeing them presented in such a polished manner has appeared to be an easy win for game developers.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Graphics&lt;/h2&gt;
&lt;p&gt;I&amp;#8217;ve said it before, and I&amp;#8217;ll say it again: I absolutely love retro and retro-inspired games. Utopian Mining offers some very nice looking retro graphics, which instantly earn my approval. The world is charming on the surface, and while a bit bland below, it&amp;#8217;s done well enough to please the eyes. The animations are extremely simple, but they get the job done, and there&amp;#8217;s no need for more. &lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/articles/098_utopiaMiningCritique/utopia-mining-03.png" /&gt;&lt;/div&gt;
&lt;p&gt;As far as details go, the game doesn&amp;#8217;t skimp out, and there&amp;#8217;s actually a decent attention to detail. The ground gets darker as you go deeper, digging has a cool particle effect of dirt flying out, and warnings appear in a simple, but cool fashion across the screen. Overall, the graphics are top-notch for a retro-inspired style, and I wouldn&amp;#8217;t change them a bit.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Audio&lt;/h2&gt;
&lt;p&gt;The audio is also extremely well done in Utopian Mining, and has very little room for improvement. The music on the surface is excellent and charming, which sets an immediately positive mood for players. Upon digging and going below the surface, the music instantly changes with a nice fading touch, which is a great addition. &lt;/p&gt;
&lt;p&gt;Sound effects are nicely done, even if a bit simple. I would have appreciated some variation when collecting different materials, but that&amp;#8217;s a minor piece of polish the develop chose not to include. All in all, the sounds are quite fitting, retro, and very well done.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Utopian Mining is undeniably a great game, it&amp;#8217;s just a great game that has been done before. What I appreciate most about it, is that it takes the core mechanics, leaves behind the extras, and makes the game shine nonetheless. It&amp;#8217;s an excellent game for developers to study, as there&amp;#8217;s very little to it, yet it&amp;#8217;s quite successful. I know my interest has been piqued by it, and I plan to explore development in the genre myself. All in all, Utopian Mining is a charming and simple game that can pass some time for the casual gamer, teach some important lessons to game developers looking for them, or both.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;Your Turn&lt;/h2&gt;
&lt;p&gt;What do you think of Utopian Mining?&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/rpZhunDW29W3-5aBK9mBgOJwJDE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rpZhunDW29W3-5aBK9mBgOJwJDE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/rpZhunDW29W3-5aBK9mBgOJwJDE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rpZhunDW29W3-5aBK9mBgOJwJDE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=oCIVhWuG_8c:o0rNqgteYMg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=oCIVhWuG_8c:o0rNqgteYMg:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=oCIVhWuG_8c:o0rNqgteYMg:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=oCIVhWuG_8c:o0rNqgteYMg:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=oCIVhWuG_8c:o0rNqgteYMg:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=oCIVhWuG_8c:o0rNqgteYMg:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=oCIVhWuG_8c:o0rNqgteYMg:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=oCIVhWuG_8c:o0rNqgteYMg:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=oCIVhWuG_8c:o0rNqgteYMg:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=oCIVhWuG_8c:o0rNqgteYMg:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Flashtuts/~4/oCIVhWuG_8c" height="1" width="1"/&gt;</description>
		<wfw:commentRss>http://active.tutsplus.com/articles/critique/workshop-utopian-mining-critique/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://active.tutsplus.com/articles/critique/workshop-utopian-mining-critique/</feedburner:origLink></item>
		<item>
		<title>Using ASAudio for Easy Flash Sound Playback</title>
		<link>http://feedproxy.google.com/~r/Flashtuts/~3/_TLI_6EdVEg/</link>
		<comments>http://active.tutsplus.com/tutorials/actionscript/using-asaudio-for-easy-flash-sound-playback/#comments</comments>
		<pubDate>Wed, 02 May 2012 09:00:36 +0000</pubDate>
		<dc:creator>James Tyner</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Media]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[asaudio]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[handy classes]]></category>
		<category><![CDATA[sound]]></category>
		<guid isPermaLink="false">http://active.tutsplus.com/?p=11397</guid>
		<description>&lt;p&gt;In this short tutorial I will introduce you to ASAudio, and AS3 library that greatly reduces the amount of code needed to create and manipulate sound object in your ActionScript projects.&lt;/p&gt;
&lt;p&gt;&lt;span id="more-11397"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 1:&lt;/span&gt; Examining ASAudio&lt;/h2&gt;
&lt;p&gt;ASAudio is an ActionScript 3 library that greatly reduces the amount of code needed to create and manipulate (volume changes, pan) audio files&amp;#8217; within your ActionScript Projects. Traditionally you would need to do the following to load in, play, and change the volume of a Sound within ActionScript:&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
var urlRequest:URLRequest = new URLRequest(&amp;quot;path/to/track.mp3&amp;quot;);
var sound:Sound = new Sound(urlRequest);
var soundChannel:SoundChannel = sound.play();
var soundTrans:SoundTransform = soundChannel.soundTransform;
soundTrans.volume = .5;
soundChannel.soundTransform = soundTrans;
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;With ASAudio all you need to do is the following&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
var track:Track = new Track(&amp;quot;path/to/track.mp3&amp;quot;);
track.start();
track.volume = .5;
&lt;/pre&gt;
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 2:&lt;/span&gt; Getting the Library&lt;/h2&gt;
&lt;p&gt;Head over to &lt;a href="http://code.google.com/p/asaudio/"&gt;the project&amp;#8217;s Google Code page&lt;/a&gt; and download the latest version of ASAudio.&lt;/p&gt;
&lt;p&gt;Once you have downloaded it, extract it and copy the the &amp;#8220;com&amp;#8221; folder that is inside the &amp;#8220;src&amp;#8221; folder to the folder where you will be creating your ActionScript project.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 3:&lt;/span&gt; New ActionScript Project&lt;/h2&gt;
&lt;p&gt;Start a new ActionScript project, and save it in your project folder as &amp;#8220;asAudio.fla&amp;#8221;. Under the &amp;#8220;PROPERTIES&amp;#8221; panel, set the stage color to white and give it a width and height of 500x150px.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/tuts/438_qtASAudio/properties.png" alt="" /&gt;&lt;/div&gt;
&lt;p&gt;Now create a new ActionScript File and save this as &amp;#8220;Main.as&amp;#8221;. Set this as your &lt;a href="http://active.tutsplus.com/tutorials/actionscript/quick-tip-how-to-use-a-document-class-in-flash/"&gt;Document Class&lt;/a&gt;.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 5:&lt;/span&gt; Imports and Constructor Function&lt;/h2&gt;
&lt;p&gt;Add the following to the &amp;#8220;Main.as&amp;#8221; you created in the step above.&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
package  {
	import flash.display.Sprite;
	import com.neriksworkshop.lib.ASaudio.*;
	import flash.media.Sound;
	import flash.events.MouseEvent;
	import flash.events.Event;

	public class Main extends Sprite {

		public function Main() {
			trace(&amp;quot;Working&amp;quot;);
		}

    }

}
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;Here we import the classes we will need throughout this tutorial, and setup our &lt;code&gt;Main()&lt;/code&gt; constructor.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 6:&lt;/span&gt; Track&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;Track&lt;/code&gt; is the fundamental class of ASAudio. Everything you do with the library depends on the &lt;code&gt;Track&lt;/code&gt;. In this step we will create a new &lt;code&gt;Track&lt;/code&gt;, and play it. Enter the following code above the &lt;code&gt;Main()&lt;/code&gt; within &amp;#8220;Main.as&amp;#8221;.&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
var track:Track = new Track(&amp;quot;BoozeandBlues.mp3&amp;quot;);
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;And the following within the &lt;code&gt;Main()&lt;/code&gt; constructor.&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; highlight: [2]; title: ; notranslate"&gt;
public function Main() {
	track.start();
}
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;To create a &lt;code&gt;Track&lt;/code&gt; you pass in a path to the mp3. We then call the &lt;code&gt;start()&lt;/code&gt; method of the &lt;code&gt;Track&lt;/code&gt; within &lt;code&gt;Main()&lt;/code&gt;.
&lt;p&gt;If you test now you should hear the mp3 play.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 7:&lt;/span&gt; Setting up the Interface&lt;/h2&gt;
&lt;p&gt;In this step we will setup the interface for the project so we can control our &lt;code&gt;Track&lt;/code&gt;&amp;#8216;s.&lt;/p&gt;
&lt;p&gt;From the Component Window drag 4 buttons and a slider onto the Stage. You can get to the Components Window by choosing Window &gt; Components or by pressing CTRL+F7.&lt;/p&gt;
&lt;p&gt;Give the buttons the following properties, one by one.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;X: 21.00 , Y:61.00, Label:&amp;#8221;Play TracK&amp;#8221;, Instance Name:&amp;#8221;playTrackBtn&amp;#8221;&lt;/li&gt;
&lt;li&gt;X: 175.00, Y:61.00, Label:&amp;#8221;Play Group&amp;#8221;,  Instance Name&amp;#8221;playGroupBtn&amp;#8221;&lt;/li&gt;
&lt;li&gt;X: 333.00, Y:61.00, Label:&amp;#8221;Play Playlist&amp;#8221;, Instance Name&amp;#8221;playListBtn&amp;#8221;&lt;/li&gt;
&lt;li&gt;X: 21.00,  Y:100.00, Label:&amp;#8221;Stop Track&amp;#8221;, Instance Name&amp;#8221;stopTrackBtn&amp;#8221;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here is a screenshot of the first Button&amp;#8217;s setup.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;&lt;img src="http://d2fhka9tf2vaj2.cloudfront.net/tuts/438_qtASAudio/buttons_props.png" alt="" /&gt;&lt;/div&gt;
&lt;p&gt;Give the slider the following properties.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;X: 21.00, Y:29.00, Instance Name:&amp;#8221;trackSlider&amp;#8221;&lt;/li&gt;
&lt;li&gt;maximum: 1&lt;/li&gt;
&lt;li&gt;miniumum: 0.1&lt;/li&gt;
&lt;li&gt;snapInterval: 0.1&lt;/li&gt;
&lt;li&gt;tickInterval: 0.1&lt;/li&gt;
&lt;li&gt;value: 1&lt;/li&gt;
&lt;li&gt;liveDragging: &amp;#8220;Make sure it is checked&amp;#8221;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here we set some initial values for the slider. I won&amp;#8217;t go over them as you can refer to my &lt;a href="http://active.tutsplus.com/tutorials/tools-tips/quick-introduction-flash-numericstepper-slider-and-progressbar-components/"&gt;Quick Tip&lt;/a&gt; that covers the sliders functionality.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 8:&lt;/span&gt; Controlling the Track&lt;/h2&gt;
&lt;p&gt;In this step we will code the start, stop, and volume functionality for the track we created in the previous step. Add the following to &amp;#8220;Main.as&amp;#8221;.&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; highlight: [2]; title: ; notranslate"&gt;
public function Main() {
	addListeners();
}

private function addListeners():void{
   trackSlider.enabled = false;
   playTrackBtn.addEventListener(MouseEvent.CLICK,playTrack);
   stopTrackBtn.addEventListener(MouseEvent.CLICK,stopTrack);
   trackSlider.addEventListener(Event.CHANGE,adjustTrackVolume);

}
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;Here we call the &lt;code&gt;addListeners()&lt;/code&gt; function within our &lt;code&gt;Main()&lt;/code&gt; constructor. Inside &lt;code&gt;addListeners&lt;/code&gt; we set the disable the &lt;code&gt;trackSlider&lt;/code&gt; and add Listeners to 3 of our buttons.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;&lt;span&gt;Step 9:&lt;/span&gt; &lt;code&gt;playTrack()&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;playTrack()&lt;/code&gt; function will tell the track to start playing. Add the following beneath the &lt;code&gt;addListeners()&lt;/code&gt; function you created in the step above.&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
private function playTrack(e:MouseEvent):void{
   trackSlider.enabled = true;
   track.start();
   track.volume = 1.0;
}
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;Here we enable the &lt;code&gt;trackSlider&lt;/code&gt; play the &lt;code&gt;Track&lt;/code&gt; using the &lt;code&gt;start()&lt;/code&gt; method and set the volume of the track using the  volume property.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 10:&lt;/span&gt; &lt;code&gt;stopTrack()&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;stopTrack()&lt;/code&gt; function will be used to stop the &lt;code&gt;Track&lt;/code&gt;. Add the following beneath the &lt;code&gt;playTrack()&lt;/code&gt; function you added in the step above.&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
private function stopTrack(e:MouseEvent):void{
	track.stop();
}
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;Here we simply call the &lt;code&gt;stop()&lt;/code&gt; method on the &lt;code&gt;Track&lt;/code&gt;.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 11:&lt;/span&gt; &lt;code&gt;adjustTrackVolume()&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;adjustTrackVolume()&lt;/code&gt; function will be used to adjust the volume of the &lt;code&gt;Track&lt;/code&gt;. Add the following beneath the &lt;code&gt;stopTrack()&lt;/code&gt; function you created in the step above.&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
private function adjustTrackVolume(e:Event):void{
   track.volume = e.target.value;
}
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;Here we set the volume of the track equal the the sliders &lt;code&gt;value&lt;/code&gt; property. Because we set the maximum to 1 and the minimum to 0.1 it will always be a number between 0.1 and 1.0 incremented by 10ths. i.e 0.1, 0.4, and so on.&lt;/p&gt;
&lt;p&gt;If you test the movie now you should be able to play, stop, and adjust the volume of the &lt;code&gt;Track&lt;/code&gt;.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 12:&lt;/span&gt; Groups&lt;/h2&gt;
&lt;p&gt;You may have been wondering what the &amp;#8220;Play Group&amp;#8221; button was for? Well, along with offering basic the basic &lt;code&gt;Track&lt;/code&gt; ASAudio has a notion of &amp;#8220;Groups&amp;#8221; which allows you to stack sounds together and play them together all at once. Add the following within the &lt;code&gt;addListeners()&lt;/code&gt; function you created in the step above.&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; highlight: [6]; title: ; notranslate"&gt;
 private function addListeners():void{
   trackSlider.enabled = false;
   playTrackBtn.addEventListener(MouseEvent.CLICK,playTrack);
   stopTrackBtn.addEventListener(MouseEvent.CLICK,stopTrack);
   trackSlider.addEventListener(Event.CHANGE,adjustTrackVolume);
   playGroupBtn.addEventListener(MouseEvent.CLICK,playGroup);
}
 &lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;Here we add a Listener to our &lt;code&gt;playGroupBtn&lt;/code&gt; that will call the &lt;code&gt;playGroup()&lt;/code&gt; function. We will code this next.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;&lt;span&gt;Step 13:&lt;/span&gt; &lt;code&gt;playGroup()&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;Add the following beneath the &lt;code&gt;adjustTrackVolume()&lt;/code&gt; function you creafted in the step above.&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
 private function playGroup(e:Event):void{
   var group:Group = new Group( [new Track(&amp;quot;piano.mp3&amp;quot;), new Track(&amp;quot;drumbeat.mp3&amp;quot;)] );
   group.start();
}
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;Here we create a new &lt;code&gt;Group&lt;/code&gt; by passing in an Array of tracks. We then call the &lt;code&gt;start()&lt;/code&gt; method which tells the &lt;code&gt;Group&lt;/code&gt; to start playing.&lt;/p&gt;
&lt;p&gt;If you test now you should hear the &amp;#8220;piano.mp3&amp;#8243; and &amp;#8220;drumbeat.mp3&amp;#8243; playing simutaneously.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;&lt;span&gt;Step 14:&lt;/span&gt; Playlist&lt;/h2&gt;
&lt;p&gt;Along with offering the &lt;code&gt;Group&lt;/code&gt;, ASAudio has a notion of a &lt;code&gt;PlayList&lt;/code&gt;. The &lt;code&gt;PlayList&lt;/code&gt; is like a playlist on an MP3 player. You &amp;#8220;queue&amp;#8221; up songs and when one finishes it continues to the next. Add the following within the &lt;code&gt;addListeners&lt;/code&gt; function.&lt;/p&gt;
&lt;pre&gt;
&lt;pre class="brush: as3; title: ; notranslate"&gt;
private function playPlayList(e:Event):void{
   var playList:Playlist = new Playlist( [new Track(&amp;quot;piano.mp3&amp;quot;), new Track(&amp;quot;drumbeat.mp3&amp;quot;)] );
   playList.loop = false;
   playList.start();
}
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;Like the &lt;code&gt;Group&lt;/code&gt; we create a new &lt;code&gt;PlayList&lt;/code&gt; by passing in an Array of Tracks. We set the &lt;code&gt;PlayList&lt;/code&gt; to not loop and call the &lt;code&gt;start()&lt;/code&gt; method.&lt;/p&gt;
&lt;p&gt;You can now test and see the &lt;code&gt;PlayList&lt;/code&gt; in action.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;You have learned about ASAudio and seen how it can greatly reduce the amount of code needed to create Audio within your ActionScript Projects. This library has more to offer including fade, pause, and mute methods&amp;#8230; I suggest you take a look through the &lt;a href="http://nerik.me/project/ASaudio/doc/"&gt;documentation&lt;/a&gt; to see what all is available. I hope you found this useful and thanks for reading!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/jeI1oVP_MruQjlKbV6qlgUeGMik/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jeI1oVP_MruQjlKbV6qlgUeGMik/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/jeI1oVP_MruQjlKbV6qlgUeGMik/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jeI1oVP_MruQjlKbV6qlgUeGMik/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=_TLI_6EdVEg:7Ez5FOTLdx4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=_TLI_6EdVEg:7Ez5FOTLdx4:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=_TLI_6EdVEg:7Ez5FOTLdx4:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=_TLI_6EdVEg:7Ez5FOTLdx4:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=_TLI_6EdVEg:7Ez5FOTLdx4:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=_TLI_6EdVEg:7Ez5FOTLdx4:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=_TLI_6EdVEg:7Ez5FOTLdx4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=_TLI_6EdVEg:7Ez5FOTLdx4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Flashtuts?a=_TLI_6EdVEg:7Ez5FOTLdx4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Flashtuts?i=_TLI_6EdVEg:7Ez5FOTLdx4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Flashtuts/~4/_TLI_6EdVEg" height="1" width="1"/&gt;</description>
		<wfw:commentRss>http://active.tutsplus.com/tutorials/actionscript/using-asaudio-for-easy-flash-sound-playback/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://active.tutsplus.com/tutorials/actionscript/using-asaudio-for-easy-flash-sound-playback/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic Page Served (once) in 0.642 seconds -->

