<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>iD Tech Camps - America's #1 Tech Camp&#187; Flash</title>
	<atom:link href="http://www.internaldrive.com/tag/flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.internaldrive.com</link>
	<description>America's #1 Tech Camp</description>
	<lastBuildDate>Thu, 19 Nov 2009 21:24:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Summer Computer Camp Photos-of-the-Week for 7-5-09</title>
		<link>http://www.internaldrive.com/2009/07/09/summer-computer-camp-photos-of-the-week-for-7-5-09/</link>
		<comments>http://www.internaldrive.com/2009/07/09/summer-computer-camp-photos-of-the-week-for-7-5-09/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 18:25:54 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[iD Tech Camps]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[camps]]></category>
		<category><![CDATA[day camp]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[Gaming]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[modding]]></category>
		<category><![CDATA[overnight camp]]></category>
		<category><![CDATA[photo]]></category>
		<category><![CDATA[photos]]></category>
		<category><![CDATA[robotics]]></category>
		<category><![CDATA[robots]]></category>
		<category><![CDATA[style]]></category>
		<category><![CDATA[Summer Camps]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://www.internaldrive.com/?p=22900</guid>
		<description><![CDATA[Most of our summer camp locations are in session this week, so let&#8217;s look at some photos! This week&#8217;s theme was &#8220;Products, Hardware and Software.&#8221; We looked through the many photos on http://www.internaldrive.com/photos and are pleased to announce this week&#8217;s photo-of-the-week winners. Thanks for taking the time to take great photos and portraying what our [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>Most of our summer camp locations are in session this week, so let&#8217;s look at some photos! This week&#8217;s theme was &#8220;Products, Hardware and Software.&#8221; We looked through the many photos on <a href="http://www.internaldrive.com/photos">http://www.internaldrive.com/photos</a> and are pleased to announce this week&#8217;s photo-of-the-week winners. Thanks for taking the time to take great photos and portraying what our summer camps for kids and teens are truly like!</p>
<p class="MsoNormal" style="line-height: normal;" mce_style="line-height: normal;"><a href="http://www.internaldrive.com/wp-content/uploads/2009/07/ucla_73_a.jpg" mce_href="http://www.internaldrive.com/wp-content/uploads/2009/07/ucla_73_a.jpg"><img class="alignnone size-medium wp-image-22901" title="ucla_73_a" src="http://www.internaldrive.com/wp-content/uploads/2009/07/ucla_73_a-225x300.jpg" mce_src="http://www.internaldrive.com/wp-content/uploads/2009/07/ucla_73_a-225x300.jpg" alt="ucla 73 a 225x300 Summer Computer Camp Photos of the Week for 7 5 09" width="225" height="300" /></a></p>
<p class="MsoNormal" style="line-height: normal;" mce_style="line-height: normal;">This summer day camp student shows off his camera skills at UCLA.</p>
<p><a href="http://www.internaldrive.com/wp-content/uploads/2009/07/uta_a_73.jpg" mce_href="http://www.internaldrive.com/wp-content/uploads/2009/07/uta_a_73.jpg"><img class="alignnone size-medium wp-image-22902" title="uta_a_73" src="http://www.internaldrive.com/wp-content/uploads/2009/07/uta_a_73-300x225.jpg" mce_src="http://www.internaldrive.com/wp-content/uploads/2009/07/uta_a_73-300x225.jpg" alt="uta a 73 300x225 Summer Computer Camp Photos of the Week for 7 5 09" width="262" height="196" /></a></p>
<p>Ninja versus Ninja<sup>TM</sup> at our UT Austin summer camp.</p>
<p><a href="http://www.internaldrive.com/wp-content/uploads/2009/07/osu_73a.jpg" mce_href="http://www.internaldrive.com/wp-content/uploads/2009/07/osu_73a.jpg"><img class="alignnone size-medium wp-image-22903" title="osu_73a" src="http://www.internaldrive.com/wp-content/uploads/2009/07/osu_73a-300x225.jpg" mce_src="http://www.internaldrive.com/wp-content/uploads/2009/07/osu_73a-300x225.jpg" alt="osu 73a 300x225 Summer Computer Camp Photos of the Week for 7 5 09" width="300" height="225" /></a></p>
<p>Web Design &amp; Flash Animation with Wacom® Pen Tablets at Ohio State.</p>
<p><a href="http://www.internaldrive.com/wp-content/uploads/2009/07/idga_vill_73_a.jpg" mce_href="http://www.internaldrive.com/wp-content/uploads/2009/07/idga_vill_73_a.jpg"><img class="alignnone size-medium wp-image-22904" title="idga_vill_73_a" src="http://www.internaldrive.com/wp-content/uploads/2009/07/idga_vill_73_a-300x225.jpg" mce_src="http://www.internaldrive.com/wp-content/uploads/2009/07/idga_vill_73_a-300x225.jpg" alt="idga vill 73 a 300x225 Summer Computer Camp Photos of the Week for 7 5 09" width="300" height="225" /></a></p>
<p>Game Modding with Warcraft® III at the Villanova Gaming Academy.</p>
<p><a href="http://www.internaldrive.com/wp-content/uploads/2009/07/rollins_73_a.jpg" mce_href="http://www.internaldrive.com/wp-content/uploads/2009/07/rollins_73_a.jpg"><img class="alignnone size-medium wp-image-22905" title="rollins_73_a" src="http://www.internaldrive.com/wp-content/uploads/2009/07/rollins_73_a-300x168.jpg" mce_src="http://www.internaldrive.com/wp-content/uploads/2009/07/rollins_73_a-300x168.jpg" alt="rollins 73 a 300x168 Summer Computer Camp Photos of the Week for 7 5 09" width="300" height="168" /></a></p>
<p>Camp activities include Apples to Apples at Rollins College.</p>
<p><a href="http://www.internaldrive.com/wp-content/uploads/2009/07/santa-clara_73_a.jpg" mce_href="http://www.internaldrive.com/wp-content/uploads/2009/07/santa-clara_73_a.jpg"><img class="alignnone size-medium wp-image-22906" title="santa-clara_73_a" src="http://www.internaldrive.com/wp-content/uploads/2009/07/santa-clara_73_a-300x225.jpg" mce_src="http://www.internaldrive.com/wp-content/uploads/2009/07/santa-clara_73_a-300x225.jpg" alt="santa clara 73 a 300x225 Summer Computer Camp Photos of the Week for 7 5 09" width="300" height="225" /></a></p>
<p>Looking up from her Dell Computer at our Santa Clara summer camp.</p>
<p><a href="http://www.internaldrive.com/wp-content/uploads/2009/07/shu_73_a.jpg" mce_href="http://www.internaldrive.com/wp-content/uploads/2009/07/shu_73_a.jpg"><img class="alignnone size-medium wp-image-22908" title="shu_73_a" src="http://www.internaldrive.com/wp-content/uploads/2009/07/shu_73_a-300x225.jpg" mce_src="http://www.internaldrive.com/wp-content/uploads/2009/07/shu_73_a-300x225.jpg" alt="shu 73 a 300x225 Summer Computer Camp Photos of the Week for 7 5 09" width="300" height="225" /></a></p>
<p>Working with Adobe® Illustrator® CS4 at Sacred Heart University.</p>
<p><a href="http://www.internaldrive.com/wp-content/uploads/2009/07/uci_75_a.jpg" mce_href="http://www.internaldrive.com/wp-content/uploads/2009/07/uci_75_a.jpg"><img class="alignnone size-medium wp-image-22909" title="uci_75_a" src="http://www.internaldrive.com/wp-content/uploads/2009/07/uci_75_a-300x221.jpg" mce_src="http://www.internaldrive.com/wp-content/uploads/2009/07/uci_75_a-300x221.jpg" alt="uci 75 a 300x221 Summer Computer Camp Photos of the Week for 7 5 09" width="300" height="221" /></a></p>
<p>Outdoor summer camp activities at UC Irvine.</p>
<p><a href="http://www.internaldrive.com/wp-content/uploads/2009/07/mit_73_a.jpg" mce_href="http://www.internaldrive.com/wp-content/uploads/2009/07/mit_73_a.jpg"><img class="alignnone size-medium wp-image-22910" title="mit_73_a" src="http://www.internaldrive.com/wp-content/uploads/2009/07/mit_73_a-225x300.jpg" mce_src="http://www.internaldrive.com/wp-content/uploads/2009/07/mit_73_a-225x300.jpg" alt="mit 73 a 225x300 Summer Computer Camp Photos of the Week for 7 5 09" width="225" height="300" /></a></p>
<p>Vex® Robotics at our MIT summer camp.</p>
<p><a href="http://www.internaldrive.com/wp-content/uploads/2009/07/uw_73_a.jpg" mce_href="http://www.internaldrive.com/wp-content/uploads/2009/07/uw_73_a.jpg"><img class="alignnone size-medium wp-image-22911" title="uw_73_a" src="http://www.internaldrive.com/wp-content/uploads/2009/07/uw_73_a-300x225.jpg" mce_src="http://www.internaldrive.com/wp-content/uploads/2009/07/uw_73_a-300x225.jpg" alt="uw 73 a 300x225 Summer Computer Camp Photos of the Week for 7 5 09" width="300" height="225" /></a></p>
<p>Excited over his Spore<sup>TM</sup> creature at our University of Washington camp.<--></p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.internaldrive.com/2009/07/09/summer-computer-camp-photos-of-the-week-for-7-5-09/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial: Flash Animation for Beginners 2</title>
		<link>http://www.internaldrive.com/2009/04/17/tutorial-flash-animation-for-beginners-2/</link>
		<comments>http://www.internaldrive.com/2009/04/17/tutorial-flash-animation-for-beginners-2/#comments</comments>
		<pubDate>Fri, 17 Apr 2009 16:55:35 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[iD Tech Bloggers]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[beginners]]></category>
		<category><![CDATA[chuck norris]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.internaldrive.com/?p=22013</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p><object id="csSWF" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="498" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0"><param name="src" value="http://www.internaldrive.com/blog-files/josh/vlog2.mp4"/><param name="bgcolor" value="#1a1a1a"/><param name="quality" value="best"/><param name="allowScriptAccess" value="always"/><param name="allowFullScreen" value="true"/><param name="scale" value="showall"/><param "autoplay" value="false"/><embed name="csSWF" src="http://www.internaldrive.com/blog-files/josh/vlog2.mp4" width="640" height="498" bgcolor="#1a1a1a" quality="best" allowScriptAccess="always" allowFullScreen="true" scale="showall" autoplay="false" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed></object></p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.internaldrive.com/2009/04/17/tutorial-flash-animation-for-beginners-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://www.internaldrive.com/blog-files/josh/vlog2.mp4" length="14675387" type="audio/mp4" />
		</item>
		<item>
		<title>Tutorial: Flash Animation for Beginners</title>
		<link>http://www.internaldrive.com/2009/03/27/tutorial-flash-animation-for-beginners/</link>
		<comments>http://www.internaldrive.com/2009/03/27/tutorial-flash-animation-for-beginners/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 20:45:48 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[iD Tech Bloggers]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[beginners]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.internaldrive.com/?p=21741</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p><object id="csSWF" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="498" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0"><param name="src" value="http://www.internaldrive.com/blog-files/josh/vlog1.mp4"/><param name="bgcolor" value="#1a1a1a"/><param name="quality" value="best"/><param name="allowScriptAccess" value="always"/><param name="allowFullScreen" value="true"/><param name="scale" value="showall"/><param "autoplay" value="false"/><embed name="csSWF" src="http://www.internaldrive.com/blog-files/josh/vlog1.mp4" width="640" height="498" bgcolor="#1a1a1a" quality="best" allowScriptAccess="always" allowFullScreen="true" scale="showall" autoplay="false" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed></object></p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.internaldrive.com/2009/03/27/tutorial-flash-animation-for-beginners/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
<enclosure url="http://www.internaldrive.com/blog-files/josh/vlog1.mp4" length="8463869" type="audio/mp4" />
		</item>
		<item>
		<title>Changing the default Flash cursor</title>
		<link>http://www.internaldrive.com/2009/03/07/changing-the-default-flash-cursor/</link>
		<comments>http://www.internaldrive.com/2009/03/07/changing-the-default-flash-cursor/#comments</comments>
		<pubDate>Sat, 07 Mar 2009 16:46:23 +0000</pubDate>
		<dc:creator>KenK</dc:creator>
				<category><![CDATA[iD Tech Bloggers]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.internaldrive.com/?p=21306</guid>
		<description><![CDATA[Ever wanted to use a custom animated cursor in your Flash project? This video tutorial will show you how to do so via Actionscript. Click here for the source code.


]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>Ever wanted to use a custom animated cursor in your Flash project? This video tutorial will show you how to do so via Actionscript. Click <a href="http://forum.internaldrive.com/files/vlog/VLog2FlashMouse_src.zip">here</a> for the source code.</p>
<p><object id="csSWF" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="498" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0"><param name="src" value="http://forum.internaldrive.com/files/vlog/Cursor_controller.swf"/><param name="bgcolor" value="#1a1a1a"/><param name="quality" value="best"/><param name="allowScriptAccess" value="always"/><param name="allowFullScreen" value="true"/><param name="scale" value="showall"/><param name="flashVars" value="autostart=false"/><embed name="csSWF" src="http://forum.internaldrive.com/files/vlog/Cursor_controller.swf" width="640" height="498" bgcolor="#1a1a1a" quality="best" allowScriptAccess="always" allowFullScreen="true" scale="showall" flashVars="autostart=false&#038;color=0x1A1A1A,0x1A1A1A" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed></object></p>
<p></code></p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.internaldrive.com/2009/03/07/changing-the-default-flash-cursor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WhackIt: Flash Game Video Tutorial</title>
		<link>http://www.internaldrive.com/2009/03/04/whackit-flash-game-video-tutorial/</link>
		<comments>http://www.internaldrive.com/2009/03/04/whackit-flash-game-video-tutorial/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 16:33:26 +0000</pubDate>
		<dc:creator>KenK</dc:creator>
				<category><![CDATA[iD Tech Bloggers]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[video tutorial]]></category>
		<category><![CDATA[whack-a-mole]]></category>

		<guid isPermaLink="false">http://www.internaldrive.com/?p=21300</guid>
		<description><![CDATA[Here&#8217;s another Flash video tutorial. This time we&#8217;ll be focusing on a &#8220;Whack-a-mole&#8221; type Flash game. Click here to download the accompanying source code.


]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>Here&#8217;s another Flash video tutorial. This time we&#8217;ll be focusing on a &#8220;Whack-a-mole&#8221; type Flash game. Click <a href="http://forum.internaldrive.com/files/vlog/VLog3WhackIt_src.zip">here</a> to download the accompanying source code.</p>
<p><object id="csSWF" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="498" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0"><param name="src" value="http://forum.internaldrive.com/files/vlog/WhackIt_controller.swf"/><param name="bgcolor" value="#1a1a1a"/><param name="quality" value="best"/><param name="allowScriptAccess" value="always"/><param name="allowFullScreen" value="true"/><param name="scale" value="showall"/><param name="flashVars" value="autostart=false"/><embed name="csSWF" src="http://forum.internaldrive.com/files/vlog/WhackIt_controller.swf" width="640" height="498" bgcolor="#1a1a1a" quality="best" allowScriptAccess="always" allowFullScreen="true" scale="showall" flashVars="autostart=false&#038;color=0x1A1A1A,0x1A1A1A" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed></object></p>
<p></code></p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.internaldrive.com/2009/03/04/whackit-flash-game-video-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Video Tutorial: Creating a Defender Flash Game</title>
		<link>http://www.internaldrive.com/2009/02/25/video-tutorial-creating-a-defender-flash-game/</link>
		<comments>http://www.internaldrive.com/2009/02/25/video-tutorial-creating-a-defender-flash-game/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 17:35:16 +0000</pubDate>
		<dc:creator>KenK</dc:creator>
				<category><![CDATA[iD Tech Bloggers]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[defender]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.internaldrive.com/?p=21144</guid>
		<description><![CDATA[I&#8217;ve created a video tutorial breaking down in 10 minutes how to make a Flash defender game. If you&#8217;d like to check out the game and source, they are also available. 
Play the game: http://forum.internaldrive.com/files/vlog/Yadder.swf
Download the source: http://forum.internaldrive.com/files/vlog/VLog1Yadder_src.zip

]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>I&#8217;ve created a video tutorial breaking down in 10 minutes how to make a Flash defender game. If you&#8217;d like to check out the game and source, they are also available. </p>
<p>Play the game: http://forum.internaldrive.com/files/vlog/Yadder.swf<br />
Download the source: http://forum.internaldrive.com/files/vlog/VLog1Yadder_src.zip</p>
<p><embed name="csSWF" src="http://forum.internaldrive.com/files/vlog/Yadder_controller.swf" width="640" height="498" bgcolor="#1a1a1a" quality="best" allowScriptAccess="always" allowFullScreen="true" scale="showall" flashVars="autostart=false&#038;color=0x000000,0x000000" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed></p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.internaldrive.com/2009/02/25/video-tutorial-creating-a-defender-flash-game/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
<enclosure url="http://forum.internaldrive.com/files/vlog/VLog1Yadder.mp4" length="25929326" type="video/mp4" />
		</item>
		<item>
		<title>The Ternary Operator in Flash (if-else shorthand)</title>
		<link>http://www.internaldrive.com/2009/02/09/the-ternary-operator-in-flash-if-else-shorthand/</link>
		<comments>http://www.internaldrive.com/2009/02/09/the-ternary-operator-in-flash-if-else-shorthand/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 18:33:17 +0000</pubDate>
		<dc:creator>KenK</dc:creator>
				<category><![CDATA[iD Tech Bloggers]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[conditionals]]></category>
		<category><![CDATA[CS4]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ternary operations]]></category>

		<guid isPermaLink="false">http://www.internaldrive.com/?p=20864</guid>
		<description><![CDATA[Most people fluent in Flash Actionscript are familiar with unary and binary operators, but there is also a ternary operator that can be quite useful. First, a refresh on operators:
Unary: count++;
Binary: count = count * 2;
Ternary: var result:String = (count == 0) ? &#8220;Empty&#8221; : &#8220;Not Empty&#8221;);
So what does this mean? You can use the [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>Most people fluent in Flash Actionscript are familiar with unary and binary operators, but there is also a ternary operator that can be quite useful. First, a refresh on operators:</p>
<p><em>Unary:</em> <strong>count++;</strong></p>
<p><em>Binary:</em> <strong>count = count * 2;</strong></p>
<p><em>Ternary:</em> <strong>var result:String = (count == 0) ? &#8220;Empty&#8221; : &#8220;Not Empty&#8221;);</strong></p>
<p>So what does this mean? You can use the ternary form of the if statement as a shorthand. Let&#8217;s look at the equivalent full if-else statement:</p>
<p><strong>var result:String;<br />
if (count == 0) result = &#8220;Empty&#8221;;<br />
else result = &#8220;Not Empty&#8221;;</strong></p>
<p>Of course, using the ternary operator cuts down on code readability, but three lines can effectively be cut down to one. Remember, the form is this:</p>
<p><strong>(condition) ? ifTrueDoThis : ifFalseDoThis;</strong></p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.internaldrive.com/2009/02/09/the-ternary-operator-in-flash-if-else-shorthand/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Properly Referencing Your Main Class in Flash Actionscript</title>
		<link>http://www.internaldrive.com/2008/12/19/referencing-main-class-in-flash-actionscript/</link>
		<comments>http://www.internaldrive.com/2008/12/19/referencing-main-class-in-flash-actionscript/#comments</comments>
		<pubDate>Sat, 20 Dec 2008 00:25:27 +0000</pubDate>
		<dc:creator>KenK</dc:creator>
				<category><![CDATA[iD Tech Bloggers]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Classes]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Objects]]></category>
		<category><![CDATA[Stage]]></category>

		<guid isPermaLink="false">http://www.internaldrive.com/?p=20316</guid>
		<description><![CDATA[For those of you moving from Actionscript 2 to 3 (with a heavier focus on proper object-oriented principles), you may find that accessing your Main class and Stage isn&#8217;t as straight-forward. In this post we&#8217;ll highlight organizing your classes to properly reference your main class. First, let&#8217;s take a look at our Main class:
package {
    [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>For those of you moving from Actionscript 2 to 3 (with a heavier focus on proper object-oriented principles), you may find that accessing your Main class and Stage isn&#8217;t as straight-forward. In this post we&#8217;ll highlight organizing your classes to properly reference your main class. First, let&#8217;s take a look at our Main class:</p>
<pre>package {</pre>
<pre>    import flash.display.Stage;</pre>
<pre>    import flash.display.MovieClip;</pre>
<pre>    public class Main extends MovieClip {</pre>
<pre>        private static var _instance:Main = null;</pre>
<pre>        public function Main() {</pre>
<pre>            _instance = this;</pre>
<pre>        }</pre>
<pre>        public static function getInstance():Main { return _instance; }</pre>
<pre>        public static function getStage():Stage { return getInstance().stage; }</pre>
<pre>    }</pre>
<pre>}</pre>
<p>First we define a static variable,<strong> _instance</strong>, to hold a static reference to Main. We are assuming throughout this that we will use Main statically. In other words, there will only be a single instance of our Main class. Next, in our constructor, we use the line <strong>_instance = this;</strong> to set our static version of Main to the one that is created when the constructor is called.</p>
<p>We will use two methods to get access to Main and the main stage. First, <strong>getInstace()</strong> is a static function that always returns a copy of <strong>_instance</strong>. If you want the stage instead, use <strong>getStage()</strong>. All <strong>getStage() </strong>does differently from <strong>getInstance()</strong> is return the <strong>stage</strong> property of <strong>_instance</strong> rather than the object itself. Using this format simplifies your code in other classes.</p>
<p>Now let&#8217;s say you want to use these functions in other classes to add something to the stage. Let&#8217;s pretend we have a Tree class that needs to add itself to the main stage when it is created. You could use this code:</p>
<pre>package {
    import flash.display.Sprite;&lt;/code&gt;

    public class Tree extends Sprite {
        Main.getStage().addChild(this);

        x = Math.random() * Main.getStage().stageWidth;
        y = Math.random() * Main.getStage().stageWidth;
    }
}</pre>
<p>You can see that we can easily get properties of the stage (<strong>stageWidth</strong> and <strong>stageHeight</strong>) simply by statically referencing Main. Note that we could have used the following lines instead:<br />
<code><br />
x = Math.random() * Main.getInstance().stage.stageWidth;<br />
y = Math.random() * Main.getInstance().stage.stageWidth;<br />
</code><br />
It really just depends on which example you find more elegant. One additional benefit of using the techniques described here is that you can use the <strong>getInstance()</strong> to determine if Main has loaded. Simply do:<br />
<code><br />
if (Main.getInstance() != null) { /* some function */ }<br />
</code><br />
Hope that gives you an easy framework for accessing your stage and Main class in AS3!</p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.internaldrive.com/2008/12/19/referencing-main-class-in-flash-actionscript/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
