<?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 - Adobeholic &#187; PushButton</title>
	<atom:link href="http://blog.natebeck.net/category/pushbutton/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.natebeck.net</link>
	<description>RIA Developer, Flex / Flash, Widgets</description>
	<lastBuildDate>Wed, 21 Jul 2010 19:20:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>RIARadio, GangstaCast, TheFlexShow and Tech News Today&#8230;</title>
		<link>http://blog.natebeck.net/2010/07/riaradio-gangstacast-theflexshow-and-tech-news-today/</link>
		<comments>http://blog.natebeck.net/2010/07/riaradio-gangstacast-theflexshow-and-tech-news-today/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 19:01:00 +0000</pubDate>
		<dc:creator>Nate Beck</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[PushButton]]></category>
		<category><![CDATA[ZaaLabs]]></category>
		<category><![CDATA[Flex Show]]></category>
		<category><![CDATA[GangstaCast]]></category>
		<category><![CDATA[Podcasts]]></category>
		<category><![CDATA[RIARadio]]></category>
		<category><![CDATA[Tech New Today]]></category>
		<category><![CDATA[TWiT]]></category>

		<guid isPermaLink="false">http://blog.natebeck.net/?p=1182</guid>
		<description><![CDATA[Recently I&#8217;ve had the opportunity to participate in a few podcasts, and they all seem to have come out this week. Check them out: The Flex Show &#8211; Episode 115 RIARadio &#8211; Episode 17 GangstaCast Episode 1: Celebrity Stalker Edition Also, I was thrilled to find out that I was mentioned on TWiT.tv&#8217;s Tech News]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve had the opportunity to participate in a few podcasts, and they all seem to have come out this week.  Check them out:
<p><a href="http://www.theflexshow.com/blog/index.cfm/2010/7/21/Pushbutton-Engine-with-Ben-Garney-and-Nate-Beck-The-Flex-Show-Episode-115">The Flex Show &#8211; Episode 115</a></p>
<p><a href="http://insideria.com/2010/07/riaradio-episode-17-episode-17.html">RIARadio &#8211; Episode 17</a></p>
<p><a href="http://www.flexgangsta.com/?p=54">GangstaCast Episode 1: Celebrity Stalker Edition</a></p>
<p>Also, I was thrilled to find out that I was mentioned on TWiT.tv&#8217;s Tech News Today for an article I wrote regarding tracking celebrities by scraping exif data from photos uploaded to TwitPic, yfrog, TweetPhoto and TwitGoo. &nbsp;The part when they talk about the article is about 15 minutes into the episode.</p>
<p><a href="http://www.twit.tv/tnt34">Tech News Today 34: Take Off Your Pants, America</a></p>
<p><a href="http://www.zaalabs.com/2010/07/finding-celebrity-locations-via-twitter/">Article on ZaaLabs</a></p>
<p>So all in all, it&#8217;s been a very interesting week.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.natebeck.net/2010/07/riaradio-gangstacast-theflexshow-and-tech-news-today/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speaking at 360&#124;Flex San Jose 2010</title>
		<link>http://blog.natebeck.net/2010/01/speaking-at-360flex-san-jose-2010/</link>
		<comments>http://blog.natebeck.net/2010/01/speaking-at-360flex-san-jose-2010/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 07:58:22 +0000</pubDate>
		<dc:creator>Nate Beck</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Presentations]]></category>
		<category><![CDATA[PushButton]]></category>
		<category><![CDATA[360|Flex]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[PushButton Engine]]></category>
		<category><![CDATA[Speaking]]></category>

		<guid isPermaLink="false">http://blog.natebeck.net/?p=948</guid>
		<description><![CDATA[So if you haven&#8217;t seen my fun badge there on the right side of my blog&#8230; &#8212;> I will be speaking at 360&#124;Flex San Jose. If you haven&#8217;t attended a 360&#124;Flex conference before, you really should. In my opinion, 360&#124;Flex is the best conference out there for Flex developers. It&#8217;s put on by developers for]]></description>
			<content:encoded><![CDATA[<p style="clear: both">So if you haven&#8217;t seen my fun badge there on the right side of my blog&#8230; <strong>&#8212;></strong></p>
<p style="clear: both">I will be speaking at 360|Flex San Jose.</p>
<p style="clear: both">
<p style="clear: both">If you haven&#8217;t attended a 360|Flex conference before, you really should. In my opinion, 360|Flex is the best conference out there for Flex developers. It&#8217;s put on by developers for developers.</p>
<p style="clear: both">
<p style="clear: both">It is a very focused conference, where you can really get into the nitty gritty of Flex and geek out with other members of the community. Plus the food isn&#8217;t half bad.</p>
<p style="clear: both">
<p style="clear: both">
<h3>When are you speaking?</h3>
</p>
<p style="clear: both">
<p style="clear: both">I&#8217;ll be speaking on Wednesday, March 10th (my birthday) from 1:00 pm &#8211; 2:20 pm.</p>
<p style="clear: both">
<p style="clear: both">
<h3>What will you be speaking about?</h3>
</p>
<p style="clear: both">
<p style="clear: both"><strong>Session Title:</strong> Flexible Games&#8230; game development with stuff you already know.</p>
<p style="clear: both">
<p style="clear: both"><strong>Session Level:</strong> Intermediate</p>
<p style="clear: both">
<p style="clear: both"><strong>Description:</strong> I don&#8217;t know about you&#8230; but as an enterprise software developer, sometimes I need to take a break from the corporate world and want to develop something fun. In this session Nate Beck will take you through the basics of game development using the Flex SDK you know and love.</p>
<p style="clear: both">
<p style="clear: both">Nate will walk you through setting up your development environment, the basics of game development, using the open source PushButton game engine and building a functioning game.</p>
<p style="clear: both">
<p style="clear: both">
<h3>What will Doug McCune do for revenge?</h3>
</p>
<p style="clear: both">
<p style="clear: both">For those of you who weren&#8217;t at 360|Flex in Indianapolis, <a href="http://dougmccune.com/blog/2009/05/25/i-got-punkd-at-360flex-in-my-own-session/">there was an incident</a>&#8230; You can read about it in my <a href="http://blog.natebeck.net/2009/06/punking-doug-mccune/">Punking Doug McCune</a> post.</p>
<p style="clear: both">
<p style="clear: both">Since the incident, Doug has vowed to get payback. And if you don&#8217;t know Doug, he is a scary creative guy. So we&#8217;ll have to see what he comes up with. Find out, along with me at my session.</p>
<p style="clear: both">
<p style="clear: both">
<h3>Alright I&#8217;m convinced, where do I sign up?</h3>
</p>
<p style="clear: both">
<p style="clear: both">Either <a href="http://360flex-NateB.eventbrite.com/" target="_blank">click here</a> or click the 360|Flex San Jose badge on the top right of my blog.</p>
<p style="clear: both">
<p style="clear: both">More information about travel and the conference in general can be found on the <a href="http://www.360flex.com">360|Flex Website</a>.</p>
<p><br class="final-break" style="clear: both" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.natebeck.net/2010/01/speaking-at-360flex-san-jose-2010/feed/</wfw:commentRss>
		<slash:comments>0</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>
<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>1</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>4</slash:comments>
		</item>
		<item>
		<title>Developing games with PushButton Engine &#8211; Part 1 &#8211; Using Flex and Flash Builder</title>
		<link>http://blog.natebeck.net/2009/10/developing-games-with-pushbutton-engine-using-flex-and-flash-builder/</link>
		<comments>http://blog.natebeck.net/2009/10/developing-games-with-pushbutton-engine-using-flex-and-flash-builder/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 05:38:47 +0000</pubDate>
		<dc:creator>Nate Beck</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[PushButton]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Flex Builder]]></category>
		<category><![CDATA[games]]></category>

		<guid isPermaLink="false">http://blog.natebeck.net/?p=845</guid>
		<description><![CDATA[So I know I haven&#8217;t posted in quite some time. Between work, BugQuash, MAX, contributing to PushButton Engine, my country&#8217;s 500th anniversary to plan, my wedding to arrange, my wife to murder and Guilder to frame for it, I&#8217;ve been swamped. But tonight&#8230; I break my blog silence. As I just mentioned, I&#8217;ve been contributing]]></description>
			<content:encoded><![CDATA[<p>So I know I haven&#8217;t posted in quite some time.  Between work, BugQuash, MAX, contributing to PushButton Engine, my country&#8217;s 500th anniversary to plan, my wedding to arrange, my wife to murder and Guilder to frame for it, I&#8217;ve been swamped.</p>
<p>But tonight&#8230; I break my blog silence.  As I just mentioned, I&#8217;ve been contributing to the <a href="http://pushbuttonengine.com/" target="_blank">PushButton Flash Game Engine</a>.  I&#8217;m now going to show you how to set up Flex Builder 3 or Flash Builder 4 in a way that allows you to develop games on PushButton Engine, as well as how to work on the core engine itself.  I&#8217;m breaking this down into very small pieces so that everyone can follow along.  So it&#8217;s going to be a long post with lots of pretty pictures.</p>
<p>After writing this post, it ended up being longer than I hoped.  So I&#8217;m going to write a series of posts about developing games using PushButton Engine.  This post will focus only getting set up inside Flash and Flex Builder.  The plan is to add other IDEs in as well, for example FlashDevelop, FDT, etc&#8230;</p>
<h3>Step 1 : Download the PushButton Engine source code.</h3>
<p><b>[note]</b><br />
<i>If you are not familiar with Subversion or you need a primer to the basics of contributing to or working with open source projects please check out my <a href="http://blog.natebeck.net/2009/07/getting-dirty-with-the-flex-sdk-slides-and-recording/">&#8220;Getting Dirty with the Flex SDK&#8221;</a> post, more specifically the <a href="http://experts.na3.acrobat.com/p88453631/">TechWed Presentation</a>.</i><br />
<b>[/note]</b></p>
<h1><font color="#ff0000">WARNING!! For these steps to work, you must use at least revision 602 of the PushButton Engine.</font></h1>
</p>
<p>Download the PushButton Engine core from <a href="http://code.google.com/p/pushbuttonengine/source/checkout">Google Code</a>.  Since I am a developer in the engine, I have checked out trunk and all of the branches.  My working copy is located in /pbe (or C:/pbe on Windows). I will use that location throughout the rest of this post.  Make sure that if you choose a different location that you sub it in wherever I use &#8220;/pbe&#8221;.</p>
<p>So on OS X, to checkout the source code, open up Terminal and type in the following lines:</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>
<span style="color: #c20cb9; font-weight: bold;">svn</span> checkout http:<span style="color: #000000; font-weight: bold;">//</span>pushbuttonengine.googlecode.com<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span> pbe</pre></div></div>

<h3>Step 2 : Import the PBEngine Library project within Flex/Flash Builder.</h3>
<p>Open up Flex Builder (or Flash Builder), right click in the Flex Navigator and choose Import. (You can also use File > Import > Other).<br />
<a href="http://blog.natebeck.net/wp-content/uploads/2009/10/001_import.png"><img src="http://blog.natebeck.net/wp-content/uploads/2009/10/001_import-300x225.png" alt="Import Project" title="Import Project" width="300" height="225" class="size-medium wp-image-847" /></a></p>
<p>Open up the &#8220;General&#8221; folder and choose &#8220;Existing Projects into Workspace&#8221; and click &#8220;Next&#8221;.<br />
<a href="http://blog.natebeck.net/wp-content/uploads/2009/10/002_existing.png"><img src="http://blog.natebeck.net/wp-content/uploads/2009/10/002_existing-288x300.png" alt="002_existing" title="002_existing" width="288" height="300" class="alignnone size-medium wp-image-848" /></a></p>
<p>Click the &#8220;Browse&#8221; button next to &#8220;Select root directory&#8221;.<br />
<a href="http://blog.natebeck.net/wp-content/uploads/2009/10/003_rootDir.png"><img src="http://blog.natebeck.net/wp-content/uploads/2009/10/003_rootDir-300x100.png" alt="003_rootDir" title="003_rootDir" width="300" height="100" class="alignnone size-medium wp-image-849" /></a></p>
<p>In revision 600 of the PushButton Engine I added &#8220;FB3&#8243; and &#8220;FB4&#8243; directories underneath &#8220;trunk/development&#8221;.  These directories have a Flex Library project skeleton within them that can be imported directly into Flex Builder.</p>
<p>If you are using Flex Builder 3, use the FB3 directory, and if you&#8217;re using Flash Builder 4, use the FB4 directory.<br />
<a href="http://blog.natebeck.net/wp-content/uploads/2009/10/004_selectFB3.png"><img src="http://blog.natebeck.net/wp-content/uploads/2009/10/004_selectFB3-300x184.png" alt="004_selectFB3" title="004_selectFB3" width="300" height="184" class="alignnone size-medium wp-image-850" /></a></p>
<p>Click Finish.<br />
<a href="http://blog.natebeck.net/wp-content/uploads/2009/10/005_selectedPBEngine.png"><img src="http://blog.natebeck.net/wp-content/uploads/2009/10/005_selectedPBEngine-287x300.png" alt="005_selectedPBEngine" title="005_selectedPBEngine" width="287" height="300" class="alignnone size-medium wp-image-851" /></a></p>
<p>You will see a Flex Library project in the Flex Navigator now.  You will also have an error, don&#8217;t worry, we&#8217;ll fix that in the next step.</p>
<h3>Step 3 : Setup the a Linked Resource for PBE</h3>
<p>So here is the error that you will see:<br />
<i>configuration variable &#8216;compiler.source-path&#8217; value contains unknown token &#8216;PBE&#8217;</i><br />
<a href="http://blog.natebeck.net/wp-content/uploads/2009/10/006_error.png"><img src="http://blog.natebeck.net/wp-content/uploads/2009/10/006_error-300x224.png" alt="006_error" title="006_error" width="300" height="224" class="alignnone size-medium wp-image-852" /></a></p>
<p>The project skeleton uses something called a &#8220;Linked Resource&#8221;, so that it can find the PushButton Engine source files.  To set this Linked Resource, you do the following:</p>
<p>Open up Flex Builder&#8217;s preferences.<br />
<a href="http://blog.natebeck.net/wp-content/uploads/2009/10/007_preferences.png"><img src="http://blog.natebeck.net/wp-content/uploads/2009/10/007_preferences-300x214.png" alt="007_preferences" title="007_preferences" width="300" height="214" class="alignnone size-medium wp-image-853" /></a></p>
<p>Under General > Workspace > Linked Resources&#8230; Click &#8220;New&#8230;&#8221;<br />
<a href="http://blog.natebeck.net/wp-content/uploads/2009/10/008_linkedResources.png"><img src="http://blog.natebeck.net/wp-content/uploads/2009/10/008_linkedResources-300x246.png" alt="008_linkedResources" title="008_linkedResources" width="300" height="246" class="alignnone size-medium wp-image-854" /></a></p>
<p>Click on the &#8220;Folder&#8230;&#8221; button and navigate to the PushButton Engine &#8220;trunk&#8221; folder, &#8220;/pbe/trunk&#8221; (C:/pbe/trunk on Windows).<br />
<a href="http://blog.natebeck.net/wp-content/uploads/2009/10/009_selectFolder.png"><img src="http://blog.natebeck.net/wp-content/uploads/2009/10/009_selectFolder-300x140.png" alt="009_selectFolder" title="009_selectFolder" width="300" height="140" class="alignnone size-medium wp-image-855" /></a></p>
<p>Hit &#8220;OK&#8221; and you should see PBE listed in the Linked Resources now.<br />
<a href="http://blog.natebeck.net/wp-content/uploads/2009/10/010_PBEResource.png"><img src="http://blog.natebeck.net/wp-content/uploads/2009/10/010_PBEResource-300x295.png" alt="010_PBEResource" title="010_PBEResource" width="300" height="295" class="alignnone size-medium wp-image-856" /></a></p>
<p>Clean the project to incorporate and rebuild all of the changes.<br />
<a href="http://blog.natebeck.net/wp-content/uploads/2009/10/011_cleanProject.png"><img src="http://blog.natebeck.net/wp-content/uploads/2009/10/011_cleanProject-300x208.png" alt="011_cleanProject" title="011_cleanProject" width="300" height="208" class="alignnone size-medium wp-image-857" /></a></p>
<p>If you see PBEngine.swc underneath the bin folder, you are good to go!  Nice work!<br />
<a href="http://blog.natebeck.net/wp-content/uploads/2009/10/012_projectWSource.png"><img src="http://blog.natebeck.net/wp-content/uploads/2009/10/012_projectWSource-180x300.png" alt="012_projectWSource" title="012_projectWSource" width="180" height="300" class="alignnone size-medium wp-image-858" /></a></p>
<h2>:: UPDATE ::</h2>
<p>There have been file renames and other changes in the PushButton engine since this post.  If your SWC is failing to build do the following. </p>
<p>In the Flex Navigator, right click on the PBEngine Flex Library project.  Click Properties.  Go to &#8220;Flex Build Library Path&#8221;, under &#8220;Classes&#8221; uncheck [source path] src and recheck it.  If you are using Flash Builder 4, you can simply select &#8220;Include all classes from all source paths&#8221;.  Any other questions&#8230; post a comment and I&#8217;ll answer them.</p>
<h3>Step 4 : Create your game!</h3>
<p>For this example I&#8217;m going to create a VERY simple Hello World game to show that we have everything working correctly.</p>
<p>Right-click in Flex Navigator and choose &#8220;New&#8221; > &#8220;ActionScript Project&#8221;.</p>
<p>Give it a name of &#8220;HelloGame&#8221;, and click Finish.<br />
<a href="http://blog.natebeck.net/wp-content/uploads/2009/10/013_createASOnly.png"><img src="http://blog.natebeck.net/wp-content/uploads/2009/10/013_createASOnly-178x300.png" alt="013_createASOnly" title="013_createASOnly" width="178" height="300" class="alignnone size-medium wp-image-859" /></a></p>
<p>Now, to use the PBEngine Library within our HelloGame project, we need to create a link between the two.  </p>
<p>To do this, right click on the &#8220;HelloGame&#8221; project and choose &#8220;Properties&#8221;.<br />
<a href="http://blog.natebeck.net/wp-content/uploads/2009/10/014_helloProperties.png"><img src="http://blog.natebeck.net/wp-content/uploads/2009/10/014_helloProperties-175x300.png" alt="014_helloProperties" title="014_helloProperties" width="175" height="300" class="alignnone size-medium wp-image-860" /></a></p>
<p>Choose &#8220;ActionScript Build Path&#8221; from the list, and then click on &#8220;Add Project&#8230;&#8221;<br />
<a href="http://blog.natebeck.net/wp-content/uploads/2009/10/015_AddProject.png"><img src="http://blog.natebeck.net/wp-content/uploads/2009/10/015_AddProject-300x269.png" alt="015_AddProject" title="015_AddProject" width="300" height="269" class="alignnone size-medium wp-image-861" /></a></p>
<p>You should see &#8220;PBEngine&#8221; in the list.</p>
<p>If you don&#8217;t see PBEngine, or you get a message that tells you, &#8220;There are no Flex Library projects in your workspace&#8221;, make sure that a) you have created a PBEngine Library by following the previous steps and b) the project is not closed.<br />
<a href="http://blog.natebeck.net/wp-content/uploads/2009/10/016_PBEngine.png"><img src="http://blog.natebeck.net/wp-content/uploads/2009/10/016_PBEngine-300x264.png" alt="016_PBEngine" title="016_PBEngine" width="300" height="264" class="alignnone size-medium wp-image-862" /></a></p>
<p>Select &#8220;PBEngine&#8221; and click &#8220;OK&#8221;.  You will now see PBEngine listed in the Build path libraries box.<br />
<a href="http://blog.natebeck.net/wp-content/uploads/2009/10/017_withLibrary.png"><img src="http://blog.natebeck.net/wp-content/uploads/2009/10/017_withLibrary-300x258.png" alt="017_withLibrary" title="017_withLibrary" width="300" height="258" class="alignnone size-medium wp-image-863" /></a></p>
<p>Now that the two projects are linked, you can start using classes right out of the PushButton Engine.  Code completion works, and everything compiles. Woot!<br />
<a href="http://blog.natebeck.net/wp-content/uploads/2009/10/018_Intellisense.png"><img src="http://blog.natebeck.net/wp-content/uploads/2009/10/018_Intellisense-300x186.png" alt="018_Intellisense" title="018_Intellisense" width="300" height="186" class="alignnone size-medium wp-image-864" /></a></p>
<p>Great, now let&#8217;s write our impressive Hello World game.</p>
<p>Here is the source:</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;">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> HelloGame <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> HelloGame<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>;
			Logger.<span style="color: #0066CC;">print</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>, <span style="color: #ff0000;">&quot;Hello Nate!&quot;</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>Run or Debug the game.  At first you will see a blank screen, that is expected&#8230; Press the ~ (tilde or `) key, and the PushButton Console should come up.</p>
<p>The console has some commands by default: help, version, showFps and verbose (1 || 2)<br />
<a href="http://blog.natebeck.net/wp-content/uploads/2009/10/020_console.png"><img src="http://blog.natebeck.net/wp-content/uploads/2009/10/020_console-300x213.png" alt="020_console" title="020_console" width="300" height="213" class="alignnone size-medium wp-image-866" /></a></p>
<p>You can add your own custom commands to the console to assist you while developing your games&#8230; but that is a post for another time.</p>
<p>Any questions, be sure to hit us up over on the <a href="http://pushbuttonengine.com/community/">PushButton Engine Forums</a> or in the freenode IRC channel: #pbengine.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.natebeck.net/2009/10/developing-games-with-pushbutton-engine-using-flex-and-flash-builder/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
