<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Flash CS3: Actionscript 3 (AS3) Game Primer #2: Asynchronous key detection for arcade games.</title>
	<atom:link href="http://www.8bitrocket.com/2007/09/02/flash-cs3-actionscript-3-as3-game-primer-2-asynchronous-key-detection-for-arcade-games/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.8bitrocket.com/2007/09/02/flash-cs3-actionscript-3-as3-game-primer-2-asynchronous-key-detection-for-arcade-games/</link>
	<description>Flash - HTML5 Canvas - Games - Indie - Retro - Mobile</description>
	<lastBuildDate>Sat, 11 Feb 2012 04:38:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jim</title>
		<link>http://www.8bitrocket.com/2007/09/02/flash-cs3-actionscript-3-as3-game-primer-2-asynchronous-key-detection-for-arcade-games/#comment-4331</link>
		<dc:creator>Jim</dc:creator>
		<pubDate>Tue, 25 Oct 2011 19:50:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.8bitrocket.com/2007/09/02/flash-cs3-actionscript-3-as3-game-primer-2-asynchronous-key-detection-for-arcade-games/#comment-4331</guid>
		<description>seems to be something to with arrow keys - other keys work fine. am using Chrome browser.</description>
		<content:encoded><![CDATA[<p>seems to be something to with arrow keys &#8211; other keys work fine. am using Chrome browser.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim</title>
		<link>http://www.8bitrocket.com/2007/09/02/flash-cs3-actionscript-3-as3-game-primer-2-asynchronous-key-detection-for-arcade-games/#comment-4330</link>
		<dc:creator>Jim</dc:creator>
		<pubDate>Tue, 25 Oct 2011 19:21:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.8bitrocket.com/2007/09/02/flash-cs3-actionscript-3-as3-game-primer-2-asynchronous-key-detection-for-arcade-games/#comment-4330</guid>
		<description>the last &quot;multiple key&quot; example does not work for me. I have to press up twice to get the ship to thrust.</description>
		<content:encoded><![CDATA[<p>the last &#8220;multiple key&#8221; example does not work for me. I have to press up twice to get the ship to thrust.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Blayze Millward</title>
		<link>http://www.8bitrocket.com/2007/09/02/flash-cs3-actionscript-3-as3-game-primer-2-asynchronous-key-detection-for-arcade-games/#comment-4148</link>
		<dc:creator>Blayze Millward</dc:creator>
		<pubDate>Sun, 11 Sep 2011 19:15:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.8bitrocket.com/2007/09/02/flash-cs3-actionscript-3-as3-game-primer-2-asynchronous-key-detection-for-arcade-games/#comment-4148</guid>
		<description>Brilliant post! Finally a good clear concept that doesn&#039;t mean that you are bound to using someone else&#039;s class! And, after thinking about it, I realised that I used a similar system in my AS2 game engine! :D</description>
		<content:encoded><![CDATA[<p>Brilliant post! Finally a good clear concept that doesn&#8217;t mean that you are bound to using someone else&#8217;s class! And, after thinking about it, I realised that I used a similar system in my AS2 game engine! <img src='http://www.8bitrocket.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: theo hegemann</title>
		<link>http://www.8bitrocket.com/2007/09/02/flash-cs3-actionscript-3-as3-game-primer-2-asynchronous-key-detection-for-arcade-games/#comment-3886</link>
		<dc:creator>theo hegemann</dc:creator>
		<pubDate>Tue, 19 Jul 2011 15:52:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.8bitrocket.com/2007/09/02/flash-cs3-actionscript-3-as3-game-primer-2-asynchronous-key-detection-for-arcade-games/#comment-3886</guid>
		<description>I went with a similar design. However instead of adding a new identity to the end of an array, i had the array have set positions for each key. my functions ended up being

function KeyDown(event : KeyboardEvent) : void{	if (event.keyCode == Keyboard.LEFT){		Keys[0] = event.keyCode;	}	if (event.keyCode == Keyboard.RIGHT){		Keys[1] = event.keyCode;	}	if (event.keyCode == Keyboard.DOWN){		Keys[2] = event.keyCode;	}	if (event.keyCode == Keyboard.UP){		Keys[3] = event.keyCode;	}}

function KeyUp(event : KeyboardEvent) : void{	for(var i:Number = 0; i &lt; Keys.length; i++){		if(Keys[i] == event.keyCode){			Keys.splice(i, 1, 0);		}	}}

then i just called the individual key i needed in my code below.</description>
		<content:encoded><![CDATA[<p>I went with a similar design. However instead of adding a new identity to the end of an array, i had the array have set positions for each key. my functions ended up being</p>
<p>function KeyDown(event : KeyboardEvent) : void{	if (event.keyCode == Keyboard.LEFT){		Keys[0] = event.keyCode;	}	if (event.keyCode == Keyboard.RIGHT){		Keys[1] = event.keyCode;	}	if (event.keyCode == Keyboard.DOWN){		Keys[2] = event.keyCode;	}	if (event.keyCode == Keyboard.UP){		Keys[3] = event.keyCode;	}}</p>
<p>function KeyUp(event : KeyboardEvent) : void{	for(var i:Number = 0; i &lt; Keys.length; i++){		if(Keys[i] == event.keyCode){			Keys.splice(i, 1, 0);		}	}}</p>
<p>then i just called the individual key i needed in my code below.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SEO Chester</title>
		<link>http://www.8bitrocket.com/2007/09/02/flash-cs3-actionscript-3-as3-game-primer-2-asynchronous-key-detection-for-arcade-games/#comment-3476</link>
		<dc:creator>SEO Chester</dc:creator>
		<pubDate>Tue, 26 Apr 2011 09:55:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.8bitrocket.com/2007/09/02/flash-cs3-actionscript-3-as3-game-primer-2-asynchronous-key-detection-for-arcade-games/#comment-3476</guid>
		<description>Superb, this will help so many people :-)</description>
		<content:encoded><![CDATA[<p>Superb, this will help so many people <img src='http://www.8bitrocket.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keith Way</title>
		<link>http://www.8bitrocket.com/2007/09/02/flash-cs3-actionscript-3-as3-game-primer-2-asynchronous-key-detection-for-arcade-games/#comment-2416</link>
		<dc:creator>Keith Way</dc:creator>
		<pubDate>Mon, 20 Dec 2010 19:14:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.8bitrocket.com/2007/09/02/flash-cs3-actionscript-3-as3-game-primer-2-asynchronous-key-detection-for-arcade-games/#comment-2416</guid>
		<description>Thanks</description>
		<content:encoded><![CDATA[<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bebensiganteng</title>
		<link>http://www.8bitrocket.com/2007/09/02/flash-cs3-actionscript-3-as3-game-primer-2-asynchronous-key-detection-for-arcade-games/#comment-2284</link>
		<dc:creator>bebensiganteng</dc:creator>
		<pubDate>Tue, 23 Nov 2010 12:43:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.8bitrocket.com/2007/09/02/flash-cs3-actionscript-3-as3-game-primer-2-asynchronous-key-detection-for-arcade-games/#comment-2284</guid>
		<description>thanks!</description>
		<content:encoded><![CDATA[<p>thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: George Garcha</title>
		<link>http://www.8bitrocket.com/2007/09/02/flash-cs3-actionscript-3-as3-game-primer-2-asynchronous-key-detection-for-arcade-games/#comment-2197</link>
		<dc:creator>George Garcha</dc:creator>
		<pubDate>Fri, 12 Nov 2010 18:44:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.8bitrocket.com/2007/09/02/flash-cs3-actionscript-3-as3-game-primer-2-asynchronous-key-detection-for-arcade-games/#comment-2197</guid>
		<description>Very nice post</description>
		<content:encoded><![CDATA[<p>Very nice post</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Villarreal</title>
		<link>http://www.8bitrocket.com/2007/09/02/flash-cs3-actionscript-3-as3-game-primer-2-asynchronous-key-detection-for-arcade-games/#comment-2090</link>
		<dc:creator>David Villarreal</dc:creator>
		<pubDate>Thu, 28 Oct 2010 17:10:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.8bitrocket.com/2007/09/02/flash-cs3-actionscript-3-as3-game-primer-2-asynchronous-key-detection-for-arcade-games/#comment-2090</guid>
		<description>Thanks for the article, I wasn&#039;t sure if i was doing something wrong or if it was AS3&#039;s fault for the slowness of key detection.

I am using 4 arrow keys so having that many bools would be mentally distrubing for me so what I did is create an array of &quot;keys that are pressed&quot; where the first one was the most recently pressed. 

Whenever a key is pressed its added to the front of the array IFF it is not already on it (weird bugs avoided here), and when a key is released it is removed from the array if it is in it. I then have a move method called on the loop, if the length of the array is 0 it just returns, but if its not it moves in the direction of the most recent key.

Hope this helps someone,
David
</description>
		<content:encoded><![CDATA[<p>Thanks for the article, I wasn&#8217;t sure if i was doing something wrong or if it was AS3&#8242;s fault for the slowness of key detection.</p>
<p>I am using 4 arrow keys so having that many bools would be mentally distrubing for me so what I did is create an array of &#8220;keys that are pressed&#8221; where the first one was the most recently pressed. </p>
<p>Whenever a key is pressed its added to the front of the array IFF it is not already on it (weird bugs avoided here), and when a key is released it is removed from the array if it is in it. I then have a move method called on the loop, if the length of the array is 0 it just returns, but if its not it moves in the direction of the most recent key.</p>
<p>Hope this helps someone,<br />
David</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hypermotion</title>
		<link>http://www.8bitrocket.com/2007/09/02/flash-cs3-actionscript-3-as3-game-primer-2-asynchronous-key-detection-for-arcade-games/#comment-1996</link>
		<dc:creator>Hypermotion</dc:creator>
		<pubDate>Sat, 16 Oct 2010 03:52:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.8bitrocket.com/2007/09/02/flash-cs3-actionscript-3-as3-game-primer-2-asynchronous-key-detection-for-arcade-games/#comment-1996</guid>
		<description>Thanks man ... I&#039;ll use it tomorrow .. as soon as I wake up ^_^</description>
		<content:encoded><![CDATA[<p>Thanks man &#8230; I&#8217;ll use it tomorrow .. as soon as I wake up ^_^</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chema</title>
		<link>http://www.8bitrocket.com/2007/09/02/flash-cs3-actionscript-3-as3-game-primer-2-asynchronous-key-detection-for-arcade-games/#comment-410</link>
		<dc:creator>Chema</dc:creator>
		<pubDate>Wed, 11 Aug 2010 00:35:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.8bitrocket.com/2007/09/02/flash-cs3-actionscript-3-as3-game-primer-2-asynchronous-key-detection-for-arcade-games/#comment-410</guid>
		<description>Great post! Very clear and useful, thanks.</description>
		<content:encoded><![CDATA[<p>Great post! Very clear and useful, thanks.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

