<?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; Actionscript</title>
	<atom:link href="http://www.internaldrive.com/tag/actionscript/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>Making a Flex MP3 Player</title>
		<link>http://www.internaldrive.com/2009/03/11/making-a-flex-mp3-player/</link>
		<comments>http://www.internaldrive.com/2009/03/11/making-a-flex-mp3-player/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 20:28:30 +0000</pubDate>
		<dc:creator>KenK</dc:creator>
				<category><![CDATA[iD Tech Bloggers]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[event listener]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[mouselistener]]></category>
		<category><![CDATA[mp3 player]]></category>
		<category><![CDATA[mp3s]]></category>
		<category><![CDATA[progress bar]]></category>
		<category><![CDATA[progressbar]]></category>
		<category><![CDATA[simple mp3]]></category>
		<category><![CDATA[source code]]></category>
		<category><![CDATA[visualizer]]></category>

		<guid isPermaLink="false">http://www.internaldrive.com/?p=21318</guid>
		<description><![CDATA[This entry I&#8217;ll be showcasing a simple MP3 player written in Adobe Flex. Full source code is available here.
Also included in this project is a wonderful Flex visualizer written by Ben Stucki. The player loads an MP3, either local or remote. An event listener then calls a function when loading is complete that will pull [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>This entry I&#8217;ll be showcasing a simple MP3 player written in Adobe Flex. Full source code is available <a href="http://forum.internaldrive.com/files/vlog/FlexMp3/Mp3Player.zip">here</a>.</p>
<p>Also included in this project is a <a href="http://blog.benstucki.net/?id=18">wonderful Flex visualizer</a> written by Ben Stucki. The player loads an MP3, either local or remote. An event listener then calls a function when loading is complete that will pull ID3 tag information. In this project I&#8217;m only pulling the Title, Artist, and Album tags, but you can pull any associated tag you need. We also create a visualizer component and link it to a playing sound channel, which produces the lovely visualizer.</p>
<p>You can also load remote MP3s just as easily (the default MP3 is local). Simply paste the URL for an mp3 into the text box and then hit the play button.</p>
<p>In addition I&#8217;ve incorporated a rather hackish Flex ProgressBar as a &#8220;seek&#8221; bar. The percentage of play progress is calculated and then applied to the progress bar regularly, and a MouseListener is placed on the progress bar that allows the user to click at various points along the bar. The coordinates of the mouse click are then translated into a percentage of the song length. The song is then stopped and play is started from the new location.</p>
<p><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="Mp3Player" width="100%" height="100%" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"><param name="movie" value="http://forum.internaldrive.com/files/vlog/FlexMp3/Mp3Player.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><param name="allowScriptAccess" value="sameDomain" /><embed src="http://forum.internaldrive.com/files/vlog/FlexMp3/Mp3Player.swf" quality="high" bgcolor="#ffffff" width="100%" height="100%" name="Mp3Player" align="middle" play="true" loop="false" quality="high" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"></embed></object></p>
<p>The music sample used is from <a href="http://www.wired.com/wired/archive/12.11/sample.html">Wired&#8217;s Creative Commons CD</a>. Tracks from this album can also be used to test the remote playing functionality.</p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.internaldrive.com/2009/03/11/making-a-flex-mp3-player/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</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>
