<?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>Nate Beck &#187; Tip of the day</title>
	<atom:link href="http://blog.natebeck.net/category/tip-of-the-day/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.natebeck.net</link>
	<description>AIR, Flex / Flash, FMS, PushButton, Game... Developer</description>
	<lastBuildDate>Wed, 07 Sep 2011 21:24:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Tip of the Day – Populate Version Number from an AIR Descriptor File in ANT</title>
		<link>http://blog.natebeck.net/2011/04/populate-version-number-from-an-air-descriptor-file-in-ant/</link>
		<comments>http://blog.natebeck.net/2011/04/populate-version-number-from-an-air-descriptor-file-in-ant/#comments</comments>
		<pubDate>Tue, 19 Apr 2011 19:18:22 +0000</pubDate>
		<dc:creator>Nate Beck</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Tip of the day]]></category>
		<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[ANT]]></category>

		<guid isPermaLink="false">http://blog.natebeck.net/?p=1274</guid>
		<description><![CDATA[So I&#8217;ve seen this question pop up a few times. Can I grab a version number from the app-descriptor via ant and add that to the AIR filename? Anyone know? This is a pretty straight forward thing to do using Ant-Contrib tasks, that are publicly available. You can download the example files &#8211;> here. Let&#8217;s]]></description>
			<content:encoded><![CDATA[<p>So I&#8217;ve seen this question pop up a few times.</p>
<blockquote><p>Can I grab a version number from the app-descriptor via ant and add that to the AIR filename? Anyone know?</p></blockquote>
<p>This is a pretty straight forward thing to do using <a href="http://ant-contrib.sourceforge.net/">Ant-Contrib</a> tasks, that are publicly available.</p>
<p>You can download the example files &#8211;> <a href="http://blog.natebeck.net/wp-content/uploads/tipFiles/populateVersion.zip">here</a>.</p>
<p>Let&#8217;s take a quick look at the ANT script.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;project</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;PopulateVersion&quot;</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;populateVersion&quot;</span> <span style="color: #000066;">basedir</span>=<span style="color: #ff0000;">&quot;.&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;taskdef</span> <span style="color: #000066;">resource</span>=<span style="color: #ff0000;">&quot;net/sf/antcontrib/antcontrib.properties&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;classpath<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathelement</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;./ant-contrib.jar&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/classpath<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/taskdef<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;app.descriptor&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;air-app.xml&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;populateVersion&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;Parsing application.version from ${app.descriptor}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xmlproperty</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${app.descriptor}&quot;</span> <span style="color: #000066;">prefix</span>=<span style="color: #ff0000;">&quot;airApp.appdescriptor&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;propertycopy</span> <span style="color: #000066;">property</span>=<span style="color: #ff0000;">&quot;versionNumber&quot;</span> </span>
<span style="color: #009900;">                  <span style="color: #000066;">from</span>=<span style="color: #ff0000;">&quot;airApp.appdescriptor.application.versionNumber&quot;</span> </span>
<span style="color: #009900;">                  <span style="color: #000066;">override</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;Parsed application version: ${versionNumber}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>  
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;propertyregex</span> <span style="color: #000066;">property</span>=<span style="color: #ff0000;">&quot;fileVersionNumber&quot;</span></span>
<span style="color: #009900;">                  <span style="color: #000066;">input</span>=<span style="color: #ff0000;">&quot;${versionNumber}&quot;</span></span>
<span style="color: #009900;">                  <span style="color: #000066;">regexp</span>=<span style="color: #ff0000;">&quot;\.&quot;</span></span>
<span style="color: #009900;">                  <span style="color: #000066;">replace</span>=<span style="color: #ff0000;">&quot;_&quot;</span></span>
<span style="color: #009900;">                  <span style="color: #000066;">casesensitive</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Version Number: ${versionNumber}<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>                    
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>File Version Number: ${fileVersionNumber}<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/project<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>As you can see it&#8217;s very straight forward to parse the version number out of the Application Descriptor.  The only other thing we do is us RegEx to change the periods in the version number to underscores to make for more friendly file names.</p>
<p>Using the same concept it is very easy to also populate a Version file that gets compiled into your application which can include build numbers, or other interesting things&#8230; but we&#8217;ll save that for another day.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.natebeck.net/2011/04/populate-version-number-from-an-air-descriptor-file-in-ant/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tip of the Day – Getting a SWF&#8217;s background color</title>
		<link>http://blog.natebeck.net/2010/12/tip-of-the-day-getting-a-swfs-background-color/</link>
		<comments>http://blog.natebeck.net/2010/12/tip-of-the-day-getting-a-swfs-background-color/#comments</comments>
		<pubDate>Thu, 30 Dec 2010 11:03:31 +0000</pubDate>
		<dc:creator>Nate Beck</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Tip of the day]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[ZaaLabs]]></category>

		<guid isPermaLink="false">http://blog.natebeck.net/?p=1193</guid>
		<description><![CDATA[Recently at ZaaLabs, I&#8217;ve been working on a really cool tooling platform called Eden. One of the features that Eden has is a Screen Capture plugin. Eden can send a request to a remote SWF to return a bitmap of the stage. For example, here is Eden pulling a screen capture from HanClinto&#8217;s Platformer Starter]]></description>
			<content:encoded><![CDATA[<p>Recently at <a href="http://www.zaalabs.com">ZaaLabs</a>, I&#8217;ve been working on a really cool tooling platform called Eden. One of the features that Eden has is a Screen Capture plugin. Eden can send a request to a remote SWF to return a bitmap of the stage.</p>
<p>For example, here is Eden pulling a screen capture from <a href="http://www.hanclinto.com">HanClinto&#8217;s Platformer Starter Kit</a>.</p>
<p><a href="http://blog.natebeck.net/wp-content/uploads/2010/12/ScreenCap.png" target="_blank"><img width="600" src="http://blog.natebeck.net/wp-content/uploads/2010/12/ScreenCap.png" /></a></p>
<p>Really cool! However, I quickly ran into an issue when I tried to take a screen capture of a more basic game.</p>
<p>On the right is the game running in Flash, and on the left is the screen capture.</p>
<p><a href="http://blog.natebeck.net/wp-content/uploads/2010/12/ScreenCapNoBg.png" target="_blank"><img width="600" src="http://blog.natebeck.net/wp-content/uploads/2010/12/ScreenCapNoBg.png" /></a></p>
<p>As you can see, my screen capture doesn&#8217;t include the green background.  So what happened?</p>
<p>Well it turns out the background color of a SWF isn&#8217;t actually part of the stage.  The background color that you set using the SWF Metadata tag, or set in Flash Professional is drawn directly by Flash Player.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">package
<span style="color: #66cc66;">&#123;</span>	
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;
&nbsp;
	<span style="color: #66cc66;">&#91;</span>SWF<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">backgroundColor</span>=<span style="color: #ff0000;">&quot;0x00FF00&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #808080; font-style: italic;">// &lt;--- How can I get this programmatically?</span>
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> SwfBackgroundExample <span style="color: #0066CC;">extends</span> Sprite
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> SwfBackgroundExample<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>So I had a dilemma&#8230; how could I access the backgroundColor of the SWF?  I scoured the API docs, I asked the Twitter-sphere, but no luck.  All I learned was that the backgroundColor was hard coded into the bytes of the SWF.  So I decided that&#8217;s where I needed to look for it.</p>
<h3>SwfData to the rescue.</h3>
<p>I read up on the <a href="http://www.adobe.com/content/dam/Adobe/en/devnet/swf/pdf/swf_file_format_spec_v10.pdf">Adobe SWF specification</a>, and consulted with my good friend <a href="http://www.jamesward.com/">James Ward</a>.  He pointed me in the direction of loaderInfo.bytes, which gives us access to the bytes of the currently running SWF.</p>
<p>After a few hours, I had a fun little class I like to call SwfData, which parsed the background color out of the currently running SWF&#8217;s bytes&#8230; as well as some other fun things.  Here&#8217;s how you use it:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">package
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">zaalabs</span>.<span style="color: #006600;">utils</span>.<span style="color: #006600;">SwfData</span>;
&nbsp;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;
&nbsp;
	<span style="color: #66cc66;">&#91;</span>SWF<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">backgroundColor</span>=<span style="color: #ff0000;">&quot;0x969696&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> SwfDataExample <span style="color: #0066CC;">extends</span> Sprite
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> SwfDataExample<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">data</span>:SwfData = <span style="color: #000000; font-weight: bold;">new</span> SwfData<span style="color: #66cc66;">&#40;</span>loaderInfo.<span style="color: #006600;">bytes</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;version <span style="color: #000099; font-weight: bold;">\t</span>&quot;</span>+<span style="color: #0066CC;">data</span>.<span style="color: #0066CC;">version</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;frameRate <span style="color: #000099; font-weight: bold;">\t</span>&quot;</span>+<span style="color: #0066CC;">data</span>.<span style="color: #006600;">frameRate</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;frameCount <span style="color: #000099; font-weight: bold;">\t</span>&quot;</span>+<span style="color: #0066CC;">data</span>.<span style="color: #006600;">frameCount</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;fileLength <span style="color: #000099; font-weight: bold;">\t</span>&quot;</span>+<span style="color: #0066CC;">data</span>.<span style="color: #006600;">fileLength</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;bgColor <span style="color: #000099; font-weight: bold;">\t</span>0x&quot;</span>+<span style="color: #0066CC;">data</span>.<span style="color: #0066CC;">backgroundColor</span>.<span style="color: #0066CC;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">16</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Using SwfData, I could now use the background color as the fill color of my BitmapData class.</p>
<p><a href="http://blog.natebeck.net/wp-content/uploads/2010/12/ScreenCapWBg.png" target="_blank"><img width="600" src="http://blog.natebeck.net/wp-content/uploads/2010/12/ScreenCapWBg.png" /></a></p>
<h3>Get It Here</h3>
<p>SwfData is <a href="https://github.com/ZaaLabs/ZaaUtils/blob/master/license.txt">MIT licensed</a> under ZaaUtils (do with it what you will).  It is <a href="https://github.com/ZaaLabs/ZaaUtils">available on GitHub</a></p>
<p>Questions, comments, complaints are all welcome below.</p>
<h3>== UPDATE ==</h3>
<p>So I just found out that <a href="http://wahlers.com.br/claus/blog/">Claus Wahlers</a> has an awesome, more feature complete version of an AS3 SWF parser.  It&#8217;s also <a href="https://github.com/claus/as3swf/blob/master/src/com/codeazur/as3swf/SWF.as">available on GitHub</a>.  I&#8217;m still going to keep SwfData up since it&#8217;s much more specific to getting the background color of the swf.  If you need more features, use as3swf by Claus, it&#8217;s very well done.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.natebeck.net/2010/12/tip-of-the-day-getting-a-swfs-background-color/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Tip of the Day &#8211; Updating to Flash Builder 4.0.1</title>
		<link>http://blog.natebeck.net/2010/07/tip-of-the-day-updating-to-flash-builder-4-0-1/</link>
		<comments>http://blog.natebeck.net/2010/07/tip-of-the-day-updating-to-flash-builder-4-0-1/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 20:00:00 +0000</pubDate>
		<dc:creator>Nate Beck</dc:creator>
				<category><![CDATA[Tip of the day]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[AIR 2]]></category>
		<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Flash Player 10.1]]></category>

		<guid isPermaLink="false">http://blog.natebeck.net/?p=1060</guid>
		<description><![CDATA[I recently posted about Building AIR 2 applications with Flash Builder 4. There is now an update for Flash Builder 4 which downloads and installs the Adobe Flex 4.1 SDK. According to Renaun Erickson&#8217;s post, Flex 4.1 includes Flash Player 10.1 and AIR 2.0. Now, if you&#8217;re like me and loathe the Adobe Updater&#8230; then]]></description>
			<content:encoded><![CDATA[<p>I recently posted about <a href="http://blog.natebeck.net/2010/06/tip-of-the-day-building-air-2-applications-with-flash-builder-4/">Building AIR 2 applications with Flash Builder 4</a>.</p>
<p>There is now an update for Flash Builder 4 which downloads and installs the Adobe Flex 4.1 SDK. According to <a href="http://renaun.com/blog/2010/06/flex-4-1-includes-flash-player-10-1-and-air-2-0/">Renaun Erickson&#8217;s post</a>, Flex 4.1 includes Flash Player 10.1 and AIR 2.0.</p>
<p>Now, if you&#8217;re like me and loathe the Adobe Updater&#8230; then you probably turned off the Adobe Updater notifications.</p>
<p>So here&#8217;s how to update Flash Builder to version 4.0.1 which includes the 4.1 SDK.</p>
<p>Go to Help &gt; Search for Flash Builder Updates&#8230;</p>
<p><img src="http://blog.natebeck.net/wp-content/uploads/2010/07/Screen-shot-2010-07-07-at-10.19.25-AM.png" alt="Help - Search for Flash Builder Updates...">
<p>This will launch the Adobe Application Manager and then proceed to update your software, including Flash Builder 4.</p>
<h3>== UPDATE ==</h3>
<div>If you don&#8217;t see a Flash Builder update available in Adobe Application Manager, you can <a href="http://www.adobe.us/support/flex/downloads_updaters.html#flex4">download the standalone updater from Adobe.</a></div>
<p><img src="http://blog.natebeck.net/wp-content/uploads/2010/07/Screen-shot-2010-07-07-at-9.59.30-AM.png" alt="Update Progress" width="600"></p>
<p><img src="http://blog.natebeck.net/wp-content/uploads/2010/07/Screen-shot-2010-07-07-at-10.12.33-AM.png" alt="Update Complete" width="600">
<p>Once the update is completed you can see Flash Builder is now at version 4.0.1.</p>
<p><img src="http://blog.natebeck.net/wp-content/uploads/2010/07/Screen-shot-2010-07-07-at-12.50.27-PM.png" alt="Flash Builder 4.0.1 about screen" width="600">
<p>And you now have the option for Flex 4.1 as an installed Flex SDK. You can use Flex 4.1 to develop against Flash Player 10.1 and Adobe AIR 2.0.</p>
<p><img src="http://blog.natebeck.net/wp-content/uploads/2010/07/Screen-shot-2010-07-07-at-12.45.40-PM.png" alt="4.1 is now avaliable" width="600"></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.natebeck.net/2010/07/tip-of-the-day-updating-to-flash-builder-4-0-1/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Tip of the Day &#8211; Building AIR 2 applications with Flash Builder 4</title>
		<link>http://blog.natebeck.net/2010/06/tip-of-the-day-building-air-2-applications-with-flash-builder-4/</link>
		<comments>http://blog.natebeck.net/2010/06/tip-of-the-day-building-air-2-applications-with-flash-builder-4/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 00:06:37 +0000</pubDate>
		<dc:creator>Nate Beck</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Tip of the day]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[AIR 2]]></category>

		<guid isPermaLink="false">http://blog.natebeck.net/?p=1013</guid>
		<description><![CDATA[:: Update :: This process has gotten much easier, you can now use software update to get AIR 2 as well as Flash Player 10.1 in Flash Builder&#8230; check out this post. Adobe AIR 2 and Flash Player 10.1 were released on June 10th, 2010. It&#8217;s an exciting time. This weekend I decided to do]]></description>
			<content:encoded><![CDATA[<h3>:: Update ::</h3>
<p>This process has gotten much easier, you can now use software update to get AIR 2 as well as Flash Player 10.1 in Flash Builder&#8230; check out <a href="http://blog.natebeck.net/2010/07/tip-of-the-day-updating-to-flash-builder-4-0-1/">this post</a>.</p>
<hr /></p>
<p>Adobe AIR 2 and Flash Player 10.1 were released on June 10th, 2010.  It&#8217;s an exciting time.  This weekend I decided to do some development on AIR 2 to try out some of the new features.</p>
<p>On the <a href="http://blogs.adobe.com/air/2010/06/introducing_air_2.html">Adobe AIR Team blog&#8217;s post</a> they mention that the free standalone download of the AIR 2 SDK will be available on Tuesday, June 15th&#8230; but I wanted to play with the SDK today.</p>
<p><del datetime="2010-07-07T16:52:11+00:00">So I went over to the Adobe AIR labs page and downloaded the AIR 2 Release Candidate SDK which is &#8211;> <a href="http://labs.adobe.com/downloads/air2.html">here</a>.</del></p>
<p>You can download the released SDK from &#8211;> <a href="http://www.adobe.com/cfusion/entitlement/index.cfm?e=airsdk">here</a></p>
<p>After downloading the Adobe AIR 2 SDK, I followed the directions on the <a href="http://www.adobe.com/support/documentation/en/air/2/releasenotes_developers.html#h">release notes</a> which explained how to overlay the AIR 2 SDK with my current version of Flex 4.</p>
<p>I&#8217;m on a mac, here are the commands I used in Terminal:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>Applications<span style="color: #000000; font-weight: bold;">/</span>Adobe\ Flash\ Builder\ <span style="color: #000000;">4</span><span style="color: #000000; font-weight: bold;">/</span>sdks<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">ls</span>
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-r</span> 4.0.0 4.0.0AIR2
<span style="color: #c20cb9; font-weight: bold;">ls</span>
<span style="color: #c20cb9; font-weight: bold;">cp</span> ~<span style="color: #000000; font-weight: bold;">/</span>Downloads<span style="color: #000000; font-weight: bold;">/</span>air2_rc1_sdk_mac_051110.tbz2 4.0.0AIR2
<span style="color: #7a0874; font-weight: bold;">cd</span> 4.0.0AIR2
<span style="color: #c20cb9; font-weight: bold;">tar</span> jxvf air2_rc1_sdk_mac_051110.tbz2</pre></div></div>

<p>I then added a new SDK to the installed SDK&#8217;s inside of Flash Builder:<br />
<img width="600" src="http://blog.natebeck.net/wp-content/uploads/2010/06/Screen-shot-2010-06-12-at-4.40.04-PM.png" alt="Installed SDK's in Flash Builder 4"  /></p>
<p>Now, I already had an Adobe AIR application project set up, and I switched over to the new SDK the I installed:<br />
<img width="600" src="http://blog.natebeck.net/wp-content/uploads/2010/06/Screen-shot-2010-06-12-at-4.44.22-PM.png" alt="Switched over to Flex 4.0 (AIR 2)" /></p>
<p>However, when I tried to run my AIR application, I ran into this error:</p>

<div class="wp_syntax"><div class="code"><pre class="error" style="font-family:monospace;">VerifyError: Error #1014: Class IIMEClient could not be found.
&nbsp;
	at flash.display::MovieClip/nextFrame()
	at mx.managers::SystemManager/deferredNextFrame()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:267]
	at mx.managers::SystemManager/preloader_preloaderDocFrameReadyHandler()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:2460]
	at flash.events::EventDispatcher/dispatchEventFunction()
	at flash.events::EventDispatcher/dispatchEvent()
	at mx.preloaders::Preloader/timerHandler()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\preloaders\Preloader.as:488]
	at flash.utils::Timer/_timerDispatch()
	at flash.utils::Timer/tick()</pre></div></div>

<p>After doing a bit of research I found out that my Adobe AIR project&#8217;s application descriptor file wasn&#8217;t using the correct namespace for the AIR 2.0 SDK.  According to the <a href="http://www.adobe.com/support/documentation/en/air/2/releasenotes_developers.html">Adobe AIR 2 Release Notes</a>:</p>
<blockquote><p>You must update your application descriptor file to the 2.0 namespace in order to access the new AIR 2 APIs and behavior. If your application does not require the new AIR 2 APIs and behavior, you are not required to update the namespace from 1.x based namespace. To update the namespace, change the xmlns attribute in your application descriptor to: http://ns.adobe.com/air/application/2.0</p></blockquote>
<p>Sure enough, I hadn&#8217;t changed my namespace from AIR 1.5.3 to AIR 2.<br />
<img src="http://blog.natebeck.net/wp-content/uploads/2010/06/Screen-shot-2010-06-12-at-5.01.15-PM.png" alt="" /></p>
<p> I made the change in the descriptor file, and now everything works perfectly.<br />
<img src="http://blog.natebeck.net/wp-content/uploads/2010/06/Screen-shot-2010-06-12-at-5.01.30-PM.png" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.natebeck.net/2010/06/tip-of-the-day-building-air-2-applications-with-flash-builder-4/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Developing games with PushButton Engine &#8211; Understanding Local Flash Player Security</title>
		<link>http://blog.natebeck.net/2010/01/developing-games-with-pushbutton-engine-understanding-local-flash-player-security/</link>
		<comments>http://blog.natebeck.net/2010/01/developing-games-with-pushbutton-engine-understanding-local-flash-player-security/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 10:58:23 +0000</pubDate>
		<dc:creator>Nate Beck</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[PushButton]]></category>
		<category><![CDATA[Tip of the day]]></category>
		<category><![CDATA[PBE]]></category>
		<category><![CDATA[PushButton Engine]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://blog.natebeck.net/?p=931</guid>
		<description><![CDATA[As I spend more and more time on the PushButton Engine Forums, it&#8217;s funny how often the same topic seems to come up. Today a topic showed up again, regarding running Flash swf files locally. You see this same topic in many different flavors&#8230; When I email my game to the client it won&#8217;t run]]></description>
			<content:encoded><![CDATA[<p>As I spend more and more time on the <a href="http://pushbuttonengine.com/forum/">PushButton Engine Forums</a>, it&#8217;s funny how often the same topic seems to come up.  Today a topic showed up again, regarding running Flash swf files locally. You see this same topic in many different flavors&#8230; </p>
<ul>
<li>When I email my game to the client it won&#8217;t run on his computer</li>
<li>Playing the game only works inside my Flash Builder (or Flex Builder) project development folder</li>
<li>My game worked perfectly in one folder, but no longer works when moved to another folder</li>
</ul>
<p>These issues are all part of the same underlying problem, a misunderstanding of Flash Player Security.</p>
<p>The first question you should ask yourself is&#8230; what <strong>security sandbox type</strong> is my game running in?</p>
<h3>What is a Sandbox Type?</h3>
<p>The sandbox type indicates the type of security zone in which the SWF file is operating.</p>
<p><b>Please remember that the security sandbox is determined at runtime, not compile time!</b></p>
<p>In the PushButton Engine we make identifying the security sandbox easy.  When your game starts it logs the security sandbox that your swf is currently running (you can also get this by using the built in &#8220;version&#8221; console command). It looks like this:</p>
<p><code>PBE - PushButton Engine - r841 (ZaaBot build #97) - flash - <strong>localTrusted</strong></code></p>
<p>In this case, the game is running in &#8220;localTrusted&#8221;.  Most games that you run from Flash Builder will run in the localTrusted sandbox type.  This is because Flash Builder configures your system to trust files in Flash Builder project directories.  This is meant to make our lives easier as Flash developers&#8230; but it can cause confusion.</p>
<p><b>You can figure out what sandbox you&#8217;re running in by checking Security.sandboxType at runtime.</b></p>
<h3>So what are the types of sandboxes?</h3>
<p>In Flash Player, all SWF files are placed into one of four types of sandbox:</p>
<p><strong>remote</strong>  All files from non-local URLs are placed in a remote sandbox. Basically anything loaded from the web (ex: http, https) falls into this category.  There is no access to the local filesystem.</p>
<p><strong>local-with-filesystem</strong>  This is the default sandbox for local files. SWF files in this sandbox may not contact the Internet (or any servers) in any way.  They may not access network endpoints with addresses such as http URLs. </p>
<p><strong>local-with-networking</strong>  A SWF file in this sandbox may communicate over the network but may not read from local file systems. It is the exact opposite of local-with-filesystem.</p>
<p><strong>local-trusted</strong>  This sandbox is not restricted. Any local file can be placed in this sandbox if given authorization by the end user. This authorization can come in two forms: interactively through the Settings Manager or non-interactively through an executable installer (or created manually) that creates Flash Player configuration files on the user&#8217;s computer.</p>
<h3>I added use-network=false to the compiler / flex-config file and it fixed it!</h3>
<p>That&#8217;s great, but you still need to understand what is happening.</p>
<p>When you add the &#8220;use-network=false&#8221; parameter to your compilation, you are forcing the swf into the local-with-filesystem sandbox (&#8220;user-network=true&#8221; forces local-with-networking).  This may end up giving you the desired behavior that you want, a swf that will run locally when you send it to your client or friends.  However, you may run into some issues later on.</p>
<p>What if you and your friends were competitive, and you then decided your game needs to post a high score?  You would need to make a request to a server to submit the score.  When running in the local-with-filesystem sandbox you are not able to make requests of any kind to the internet, and therefore you can&#8217;t post to the score board.</p>
<h3>So what is the solution?</h3>
<p>You could teach all of your friends how to setup their game to run in localTrusted, by configuring their security files.  But there has got to be a better way.</p>
<p>Well there is, and it all depends on how you plan to deploy your game.</p>
<h3>I want to distribute a local game.</h3>
<p>The recommended way to distribute flash games to be run locally is using the <a href="http://www.adobe.com/products/air/">Adobe AIR runtime</a>.  It&#8217;s a great platform, and gives you much more flexibility and functionality.</p>
<h3>I want to put it on a website.</h3>
<p>So the best way to test your game then would be, to put it on a website.  Now don&#8217;t get scared, this isn&#8217;t going to change your development workflow all that much.</p>
<p>The simplest way to simulate a local swf running on a website would be to have a local web-server running on you box.  I highly recommend <a href="http://www.wampserver.com/en/" target="_blank">WAMP for Windows</a>, <a href="http://www.mamp.info/en/index.html" target="_blank">MAMP for Mac OS X</a> and <a href="http://www.lamphowto.com/" target="_blank">LAMP for you Linux folk</a>.</p>
<p>You then build your game (setup your output directory to drop the files in the web root) and launch your web-browser.  Running a game swf from http://localhost will put your swf into the &#8220;remote&#8221; sandbox. You will want to do all of your testing within this sandbox, because it best mirrors the environment when you deploy your game to the web.</p>
<h3>More Information</h3>
<p>This post is just a brief overview of a very complex topic, for more information check out these resources:</p>
<p><a href="http://www.senocular.com/pub/adobe/Flash%20Player%20Security%20Basics.html" target="_blank">Flash Player Security Basics</a></p>
<p>A full hour presentation from MAX 2008 by Deneb Meketa, explaining how Flash Player Security works and why it does it that way (if you don&#8217;t want to watch the whole thing, 47:12 is where it talks about local file security).  I highly recommend everyone watch it:<br />
<a href="http://tv.adobe.com/watch/max-2008-develop/understanding-the-flash-player-security-model" target="_blank">Understanding the Flash Player Security Model</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.natebeck.net/2010/01/developing-games-with-pushbutton-engine-understanding-local-flash-player-security/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Developing games with PushButton Engine &#8211; Using the Console</title>
		<link>http://blog.natebeck.net/2009/11/developing-games-with-pushbutton-engine-using-the-console/</link>
		<comments>http://blog.natebeck.net/2009/11/developing-games-with-pushbutton-engine-using-the-console/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 09:38:10 +0000</pubDate>
		<dc:creator>Nate Beck</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[PushButton]]></category>
		<category><![CDATA[Tip of the day]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Console]]></category>
		<category><![CDATA[PBE]]></category>

		<guid isPermaLink="false">http://blog.natebeck.net/?p=888</guid>
		<description><![CDATA[One really cool feature that we have built into the PushButton Flash Game Engine is a console. Using the Console The only thing you need to do to include the Console into your project is call PBE.startup(). package &#123; import flash.display.Sprite; import com.pblabs.engine.PBE; &#160; public class HelloConsole extends Sprite &#123; public function HelloConsole&#40;&#41; &#123; PBE.startup&#40;this&#41;;]]></description>
			<content:encoded><![CDATA[<p>One really cool feature that we have built into the <a href="http://pushbuttonengine.com/">PushButton Flash Game Engine</a> is a console.</p>
<h3>Using the Console</h3>
<p>The only thing you need to do to include the Console into your project is call PBE.startup().</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">package
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">pblabs</span>.<span style="color: #006600;">engine</span>.<span style="color: #006600;">PBE</span>;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> HelloConsole <span style="color: #0066CC;">extends</span> Sprite
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> HelloConsole<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			PBE.<span style="color: #006600;">startup</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Once your game is running, to access the console press the default hot key, which is the Tilde (~) / Grave (`) key. </p>
<p><a href="http://blog.natebeck.net/wp-content/uploads/2009/11/HelloConsole.png" target="_blank"><img src="http://blog.natebeck.net/wp-content/uploads/2009/11/HelloConsole-300x229.png" alt="HelloConsole" title="HelloConsole" width="300" height="229" class="alignnone size-medium wp-image-899" /></a></p>
<p>As of this post, the latest revision of the <a href="http://www.pushbuttonengine.com">PushButton Engine</a> is revision 702.  In this version there are some commands registered by default:</p>
<ul>
<li><b>help</b> &#8211; List known commands.</li>
<li><b>clear</b> &#8211; Clears the console history.</li>
<li><b>listDisplayObjects</b> &#8211; Outputs the display list.</li>
<li><b>showFps</b> &#8211; Show an FPS/Memory usage indicator.</li>
<li><b>verbose</b> &#8211; Set verbosity level of console output.</li>
<li><b>version</b> &#8211; Echo PushButton Engine version information.</li>
</ul>
<h3>Quick Tricks</h3>
<p>The console supports a few shortcuts to make your life easier:</p>
<ul>
<li>The console is not case-sensitive, so don&#8217;t worry if you put showFps or shOwFPS, the same command will execute.</li>
<li>You can use the up and down arrows to move through your command history.</li>
<li>By pressing enter on an empty command line, you can add new lines.  This is helpful for adding space between commands to make it easier to read.</li>
<li>You can use the &#8220;name&#8221; property on a DisplayObject to make meaningful names show up in the listDisplayObjects command.</li>
<li>Different Log Levels are colored by default, to change the colors edit com.pblabs.engine.debug.LogColor.</li>
</ul>
<h3>Creating custom commands for the console</h3>
<p>The PBE console also supports the ability for the developer to add their own commands.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">package
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">pblabs</span>.<span style="color: #006600;">engine</span>.<span style="color: #006600;">PBE</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">pblabs</span>.<span style="color: #006600;">engine</span>.<span style="color: #006600;">debug</span>.<span style="color: #006600;">Console</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">pblabs</span>.<span style="color: #006600;">engine</span>.<span style="color: #006600;">debug</span>.<span style="color: #006600;">Logger</span>;
&nbsp;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ConsoleCommand <span style="color: #0066CC;">extends</span> Sprite
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> ConsoleCommand<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			PBE.<span style="color: #006600;">startup</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span><span style="color: #66cc66;">&#41;</span>;
			Console.<span style="color: #006600;">registerCommand</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;test&quot;</span>, onTestCommand, <span style="color: #ff0000;">&quot;This is a test command.&quot;</span><span style="color: #66cc66;">&#41;</span>;
			Console.<span style="color: #006600;">registerCommand</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;testStrict&quot;</span>, onTestStrict, <span style="color: #ff0000;">&quot;Test strict parameters.&quot;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		protected <span style="color: #000000; font-weight: bold;">function</span> onTestCommand<span style="color: #66cc66;">&#40;</span>... <span style="color: #006600;">args</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			Logger.<span style="color: #0066CC;">print</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>, <span style="color: #ff0000;">&quot;onTestCommand: &quot;</span>+args<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		protected <span style="color: #000000; font-weight: bold;">function</span> onTestStrict<span style="color: #66cc66;">&#40;</span>str:<span style="color: #0066CC;">String</span>, num:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			Logger.<span style="color: #0066CC;">print</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>, <span style="color: #ff0000;">&quot;You passed in the string: &quot;</span>+str<span style="color: #66cc66;">&#41;</span>;
			Logger.<span style="color: #0066CC;">print</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>, <span style="color: #ff0000;">&quot;You passed in the number: &quot;</span>+num<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Parameters are passed in sequence using spaces.  So to run the test command, I would open the console, and then type &#8220;test a b c 1 2 3&#8243;.  This would then call the onTestCommand method and pass in an array with 6 elements.</p>
<p>Below is an example of what using custom commands in the console looks like.</p>
<p><a href="http://blog.natebeck.net/wp-content/uploads/2009/11/ConsoleCommand.png"><img src="http://blog.natebeck.net/wp-content/uploads/2009/11/ConsoleCommand-300x229.png" alt="ConsoleCommand" title="ConsoleCommand" width="300" height="229" class="alignnone size-medium wp-image-895" /></a></p>
<h3>Changing the Console HotKey</h3>
<p>Some of our good friends over in the Netherlands use different keyboard layouts, so they requested the ability to change the hot key binding to another key.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">package
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">pblabs</span>.<span style="color: #006600;">engine</span>.<span style="color: #006600;">PBE</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">pblabs</span>.<span style="color: #006600;">engine</span>.<span style="color: #006600;">core</span>.<span style="color: #006600;">InputKey</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">pblabs</span>.<span style="color: #006600;">engine</span>.<span style="color: #006600;">debug</span>.<span style="color: #006600;">Console</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">pblabs</span>.<span style="color: #006600;">engine</span>.<span style="color: #006600;">debug</span>.<span style="color: #006600;">Logger</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">pblabs</span>.<span style="color: #006600;">engine</span>.<span style="color: #006600;">debug</span>.<span style="color: #006600;">UIAppender</span>;
&nbsp;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">StageAlign</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">StageScaleMode</span>;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> TestConsole <span style="color: #0066CC;">extends</span> Sprite
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> TestConsole<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			PBE.<span style="color: #006600;">startup</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			UIAppender.<span style="color: #006600;">hotKey</span> = InputKey.<span style="color: #006600;">C</span>.<span style="color: #006600;">keyCode</span>;
			Console.<span style="color: #006600;">registerCommand</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;test&quot;</span>, onTestCommand, <span style="color: #ff0000;">&quot;My test command&quot;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		protected <span style="color: #000000; font-weight: bold;">function</span> onTestCommand<span style="color: #66cc66;">&#40;</span>... <span style="color: #006600;">args</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			Logger.<span style="color: #0066CC;">print</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>, <span style="color: #ff0000;">&quot;onTestCommand: &quot;</span>+args<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p><font color="#FF0000"><b>WARNING!!!</b></font> When changing the hot key to another key, the input textfield doesn&#8217;t escape the new key binding.  So you must remove focus from the input field to use the hot key to close the console.</p>
<p>More information on this can be found in <a href="http://code.google.com/p/pushbuttonengine/issues/detail?id=98">issue 98</a>.</p>
<h3>What&#8217;s coming?</h3>
<p>I do have plans on adding either tab-complete or a drop-down auto complete list into the console which will match avaliable commands.</p>
<p>Another thing that I&#8217;m currently working on is code-named Tumbler.  It&#8217;s and Adobe AIR version of the console which has additional features to assist in debugging and troubleshooting your games.  </p>
<p>It&#8217;s a proof-of-concept at the moment&#8230; but if there is enough interest in it&#8230; I may spend more time on it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.natebeck.net/2009/11/developing-games-with-pushbutton-engine-using-the-console/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Tip of the Day &#8211; How to create a prompt field on your mx:ComboBox</title>
		<link>http://blog.natebeck.net/2009/04/tip-of-the-day-how-to-create-a-prompt-field-on-your-mxcombobox/</link>
		<comments>http://blog.natebeck.net/2009/04/tip-of-the-day-how-to-create-a-prompt-field-on-your-mxcombobox/#comments</comments>
		<pubDate>Sat, 18 Apr 2009 08:55:55 +0000</pubDate>
		<dc:creator>Nate Beck</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Tip of the day]]></category>
		<category><![CDATA[ComboBox]]></category>

		<guid isPermaLink="false">http://blog.natebeck.net/?p=772</guid>
		<description><![CDATA[For a long time I&#8217;ve been doing things like this within Flex. &#91;Bindable&#93; private var _skills:Array = &#91; &#123;label: &#34;---&#34;, id: -1&#125;, &#123;label: &#34;1 - Newbie&#34;, id: 1&#125;, &#123;label: &#34;2 - Some Experience&#34;, id: 2&#125;, &#123;label: &#34;3 - Expert&#34;, id: 3&#125;, &#123;label: &#34;4 - I'm a baller&#34;, id: 4&#125; &#93;; And then binding this data]]></description>
			<content:encoded><![CDATA[<p>For a long time I&#8217;ve been doing things like this within Flex.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&#91;</span>Bindable<span style="color: #66cc66;">&#93;</span> <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _skills:<span style="color: #0066CC;">Array</span> = 
<span style="color: #66cc66;">&#91;</span>
	<span style="color: #66cc66;">&#123;</span>label: <span style="color: #ff0000;">&quot;---&quot;</span>, id: -<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#125;</span>,
	<span style="color: #66cc66;">&#123;</span>label: <span style="color: #ff0000;">&quot;1 - Newbie&quot;</span>, id: <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#125;</span>,
	<span style="color: #66cc66;">&#123;</span>label: <span style="color: #ff0000;">&quot;2 - Some Experience&quot;</span>, id: <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#125;</span>,
	<span style="color: #66cc66;">&#123;</span>label: <span style="color: #ff0000;">&quot;3 - Expert&quot;</span>, id: <span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#125;</span>,
	<span style="color: #66cc66;">&#123;</span>label: <span style="color: #ff0000;">&quot;4 - I'm a baller&quot;</span>, id: <span style="color: #cc66cc;">4</span><span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#93;</span>;</pre></div></div>

<p>And then binding this data provider to a ComboBox&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:ComboBox</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;skillsCB&quot;</span> <span style="color: #000066;">dataProvider</span>=<span style="color: #ff0000;">&quot;{_skills}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>Well it turns out there is a much easier way of doing this that I never knew of until today.  ComboBox has a &#8220;prompt&#8221; attribute that you can set.  It&#8217;s so easy&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:ComboBox</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;skillsCB&quot;</span> <span style="color: #000066;">dataProvider</span>=<span style="color: #ff0000;">&quot;{_skills}&quot;</span> <span style="color: #000066;">prompt</span>=<span style="color: #ff0000;">&quot;---&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>I told you it was easy.  Can&#8217;t believe I never noticed it before.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.natebeck.net/2009/04/tip-of-the-day-how-to-create-a-prompt-field-on-your-mxcombobox/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tip of the Day &#8211; A new way to get involved with Flex</title>
		<link>http://blog.natebeck.net/2009/02/tip-of-the-day-a-new-way-to-get-involved-with-flex/</link>
		<comments>http://blog.natebeck.net/2009/02/tip-of-the-day-a-new-way-to-get-involved-with-flex/#comments</comments>
		<pubDate>Sun, 08 Feb 2009 07:25:23 +0000</pubDate>
		<dc:creator>Nate Beck</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Randomness]]></category>
		<category><![CDATA[Tip of the day]]></category>

		<guid isPermaLink="false">http://blog.natebeck.net/?p=679</guid>
		<description><![CDATA[So the reason I haven&#8217;t posted a tip the past couple of days is because I have been working on a new project. Check it out here &#8212;&#62; Bug Quash Please vote on the poll. We&#8217;re trying to see how much interest there is in this kind of event. Any questions, comments, ideas, complaints, suggestions,]]></description>
			<content:encoded><![CDATA[<p>So the reason I haven&#8217;t posted a tip the past couple of days is because I have been working on a new project.</p>
<p>Check it out here &#8212;&gt; <a href="http://www.bugquash.com/" target="_blank">Bug Quash</a></p>
<p>Please vote on the poll.  We&#8217;re trying to see how much interest there is in this kind of event.</p>
<p>Any questions, comments, ideas, complaints, suggestions, etc&#8230; please post them below.</p>
<p>p.s. I know&#8230; this wasn&#8217;t really a tip&#8230; but I&#8217;m tired and it&#8217;s beddy time for Nate.</p>
<h3>:: Update ::</h3>
<p>New information including how to sign up for notifications &#8212;&gt; <a href="http://blog.natebeck.net/2009/02/flex-bug-quash-quick-update/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.natebeck.net/2009/02/tip-of-the-day-a-new-way-to-get-involved-with-flex/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tip of the Day &#8211; Flipping Display Objects</title>
		<link>http://blog.natebeck.net/2009/02/tip-of-the-day-flipping-display-objects/</link>
		<comments>http://blog.natebeck.net/2009/02/tip-of-the-day-flipping-display-objects/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 05:30:48 +0000</pubDate>
		<dc:creator>Nate Beck</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Tip of the day]]></category>

		<guid isPermaLink="false">http://blog.natebeck.net/?p=674</guid>
		<description><![CDATA[The tip that helped me the most lately is the with flipping objects with the help of matrices. Here is the code: function flip&#40; display:DisplayObject, orientation:String &#41;:void &#123; &#160; var m:Matrix = display.transform.matrix; &#160; switch &#40;orientation.toUpperCase&#40;&#41;&#41; &#123; &#160; case &#34;HORIZONTAL&#34; : m.a = -1; m.tx = display.width + display.x; break; case &#34;VERTICAL&#34; : m.d =]]></description>
			<content:encoded><![CDATA[<p>The tip that helped me the most lately is the with flipping objects with the help of matrices.</p>
<p>Here is the code:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> flip<span style="color: #66cc66;">&#40;</span> display:DisplayObject, orientation:<span style="color: #0066CC;">String</span> <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
       <span style="color: #000000; font-weight: bold;">var</span> m:Matrix = display.<span style="color: #006600;">transform</span>.<span style="color: #006600;">matrix</span>;
&nbsp;
       <span style="color: #b1b100;">switch</span> <span style="color: #66cc66;">&#40;</span>orientation.<span style="color: #0066CC;">toUpperCase</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
               <span style="color: #b1b100;">case</span> <span style="color: #ff0000;">&quot;HORIZONTAL&quot;</span> :
                       m.<span style="color: #006600;">a</span> = -<span style="color: #cc66cc;">1</span>;
                       m.<span style="color: #006600;">tx</span> = display.<span style="color: #0066CC;">width</span> + display.<span style="color: #006600;">x</span>;
                       <span style="color: #b1b100;">break</span>;
               <span style="color: #b1b100;">case</span> <span style="color: #ff0000;">&quot;VERTICAL&quot;</span> :
                       m.<span style="color: #006600;">d</span> = -<span style="color: #cc66cc;">1</span>;
                       m.<span style="color: #006600;">ty</span> = display.<span style="color: #0066CC;">height</span> + display.<span style="color: #006600;">y</span>;
                       <span style="color: #b1b100;">break</span>;
       <span style="color: #66cc66;">&#125;</span>
       display.<span style="color: #006600;">transform</span>.<span style="color: #006600;">matrix</span> = m;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
flip<span style="color: #66cc66;">&#40;</span>logo, <span style="color: #ff0000;">&quot;horizontal&quot;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p><em><br />
<h5>This tip was provided by Sidney K.  Thanks Sidney!</h5>
<p></em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.natebeck.net/2009/02/tip-of-the-day-flipping-display-objects/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tip of the Day &#8211; Flex Coding Conventions</title>
		<link>http://blog.natebeck.net/2009/02/tip-of-the-day-flex-coding-conventions/</link>
		<comments>http://blog.natebeck.net/2009/02/tip-of-the-day-flex-coding-conventions/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 04:55:29 +0000</pubDate>
		<dc:creator>Nate Beck</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Tip of the day]]></category>
		<category><![CDATA[Adobe]]></category>

		<guid isPermaLink="false">http://blog.natebeck.net/?p=666</guid>
		<description><![CDATA[Today&#8217;s tip is a short one&#8230; I have begun planning a very exciting Flex-centric event that is going to be held up here in Seattle. More on that later though. Your tip for the day&#8230; The Flex SDK team has a guide that explains the coding conventions that they use within the SDK (for the]]></description>
			<content:encoded><![CDATA[<p>Today&#8217;s tip is a short one&#8230; I have begun planning a very exciting Flex-centric event that is going to be held up here in Seattle.  More on that later though.</p>
<p>Your tip for the day&#8230; The Flex SDK team has a guide that explains the coding conventions that they use within the SDK (for the most part).</p>
<p><a href="http://opensource.adobe.com/wiki/display/flexsdk/Coding+Conventions" target="_blank">Flex SDK coding conventions and best practices</a></p>
<p>I agree with almost all of the conventions they list here.  If you&#8217;re planning on <a href="http://blog.natebeck.net/2008/12/why-you-should-contribute-to-flex/" target="_blank">contributing the to Flex SDK</a>, you NEED to be familiar with these conventions.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.natebeck.net/2009/02/tip-of-the-day-flex-coding-conventions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

