<?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: Tip: Flash Key Codes</title>
	<atom:link href="http://evolve.reintroducing.com/2008/11/21/tips-n-tricks/flash-key-codes/feed/" rel="self" type="application/rss+xml" />
	<link>http://evolve.reintroducing.com/2008/11/21/tips-n-tricks/flash-key-codes/</link>
	<description>Learn &#38; Interact with the ActionScript World</description>
	<lastBuildDate>Sun, 21 Mar 2010 16:20:04 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: dela</title>
		<link>http://evolve.reintroducing.com/2008/11/21/tips-n-tricks/flash-key-codes/comment-page-1/#comment-3420</link>
		<dc:creator>dela</dc:creator>
		<pubDate>Tue, 19 May 2009 01:13:12 +0000</pubDate>
		<guid isPermaLink="false">http://evolve.reintroducing.com/?p=246#comment-3420</guid>
		<description>Hey Zevan,

thanks for posting that. Very clever short hand solution. I decided to just throw it into a class for anyone else who comes along in the future.

Thanks again,
dela

public class KeyCodes
{
  public const INVALID_INPUT:String = &quot;null&quot;;

  private var alphabet:Array;
  private var nums:Array;

  private var key:Object;

  public function KeyCodes()
  {
    init();
  }

  private function init():void
  {
    // create constants for all letter and number keys:
    alphabet = &quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&quot;.split(&#039;&#039;);
    nums = [&quot;ZERO&quot;,&quot;ONE&quot;,&quot;TWO&quot;,&quot;THREE&quot;,&quot;FOUR&quot;,&quot;FIVE&quot;,&quot;SIX&quot;,&quot;SEVEN&quot;,&quot;EIGHT&quot;,&quot;NINE&quot;];

    key = new Object();
    for (var i:int = 0; i &lt; alphabet.length; i++) {
      key[ alphabet[i] ] = 65 + i;
    }

    for (i = 0; i &lt; nums.length; i++){
      var code:int = 48 + i;
      key[ nums[i] ] = code;
    }
  }

  public function translateCodeIntoKey( keyCode:uint ):String
  {
    for ( var keyName:String in key ) {
      if ( keyCode == key[keyName] ) {
        return keyName;
      }
    }
    return INVALID_INPUT;
  }
}</description>
		<content:encoded><![CDATA[<p>Hey Zevan,</p>
<p>thanks for posting that. Very clever short hand solution. I decided to just throw it into a class for anyone else who comes along in the future.</p>
<p>Thanks again,<br />
dela</p>
<p>public class KeyCodes<br />
{<br />
  public const INVALID_INPUT:String = &#8220;null&#8221;;</p>
<p>  private var alphabet:Array;<br />
  private var nums:Array;</p>
<p>  private var key:Object;</p>
<p>  public function KeyCodes()<br />
  {<br />
    init();<br />
  }</p>
<p>  private function init():void<br />
  {<br />
    // create constants for all letter and number keys:<br />
    alphabet = &#8220;ABCDEFGHIJKLMNOPQRSTUVWXYZ&#8221;.split(&#8221;);<br />
    nums = ["ZERO","ONE","TWO","THREE","FOUR","FIVE","SIX","SEVEN","EIGHT","NINE"];</p>
<p>    key = new Object();<br />
    for (var i:int = 0; i &lt; alphabet.length; i++) {<br />
      key[ alphabet[i] ] = 65 + i;<br />
    }</p>
<p>    for (i = 0; i &lt; nums.length; i++){<br />
      var code:int = 48 + i;<br />
      key[ nums[i] ] = code;<br />
    }<br />
  }</p>
<p>  public function translateCodeIntoKey( keyCode:uint ):String<br />
  {<br />
    for ( var keyName:String in key ) {<br />
      if ( keyCode == key[keyName] ) {<br />
        return keyName;<br />
      }<br />
    }<br />
    return INVALID_INPUT;<br />
  }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Starscream, Boba Fett and Jabba the Hut&#8230;er&#8230;Jasmine the Cat&#8230;FlarToolkit AND 3D Animated Models - Sunil&#8217;s Blog</title>
		<link>http://evolve.reintroducing.com/2008/11/21/tips-n-tricks/flash-key-codes/comment-page-1/#comment-3397</link>
		<dc:creator>Starscream, Boba Fett and Jabba the Hut&#8230;er&#8230;Jasmine the Cat&#8230;FlarToolkit AND 3D Animated Models - Sunil&#8217;s Blog</dc:creator>
		<pubDate>Wed, 06 May 2009 02:26:38 +0000</pubDate>
		<guid isPermaLink="false">http://evolve.reintroducing.com/?p=246#comment-3397</guid>
		<description>[...] http://evolve.reintroducing.com/2008/11/21/tips-n-tricks/flash-key-codes/ [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://evolve.reintroducing.com/2008/11/21/tips-n-tricks/flash-key-codes/" rel="nofollow">http://evolve.reintroducing.com/2008/11/21/tips-n-tricks/flash-key-codes/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: israel</title>
		<link>http://evolve.reintroducing.com/2008/11/21/tips-n-tricks/flash-key-codes/comment-page-1/#comment-3155</link>
		<dc:creator>israel</dc:creator>
		<pubDate>Wed, 18 Mar 2009 17:24:09 +0000</pubDate>
		<guid isPermaLink="false">http://evolve.reintroducing.com/?p=246#comment-3155</guid>
		<description>Thanks for answer I resolve with textfield attributes

_tabla._Omin.maxChars=2
_tabla._Oseg.restrict = &quot;0-9&quot;;

With this limit the char that you put in the text field.

Thanks for all.</description>
		<content:encoded><![CDATA[<p>Thanks for answer I resolve with textfield attributes</p>
<p>_tabla._Omin.maxChars=2<br />
_tabla._Oseg.restrict = &#8220;0-9&#8243;;</p>
<p>With this limit the char that you put in the text field.</p>
<p>Thanks for all.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Przybylski</title>
		<link>http://evolve.reintroducing.com/2008/11/21/tips-n-tricks/flash-key-codes/comment-page-1/#comment-3154</link>
		<dc:creator>Matt Przybylski</dc:creator>
		<pubDate>Wed, 18 Mar 2009 16:46:36 +0000</pubDate>
		<guid isPermaLink="false">http://evolve.reintroducing.com/?p=246#comment-3154</guid>
		<description>@israel: i&#039;m not exactly sure i follow what you&#039;re trying to ask. key is just a generic object so evt.keyCode would not at that point be a part of it.  i think you&#039;re looking at the AS2 version of this in which case after you add key as a listener to the Key class in AS2 it would then produce the event object.  not sure if that makes any sense or not but hopefully this is what you were after.</description>
		<content:encoded><![CDATA[<p>@israel: i&#8217;m not exactly sure i follow what you&#8217;re trying to ask. key is just a generic object so evt.keyCode would not at that point be a part of it.  i think you&#8217;re looking at the AS2 version of this in which case after you add key as a listener to the Key class in AS2 it would then produce the event object.  not sure if that makes any sense or not but hopefully this is what you were after.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: israel</title>
		<link>http://evolve.reintroducing.com/2008/11/21/tips-n-tricks/flash-key-codes/comment-page-1/#comment-3153</link>
		<dc:creator>israel</dc:creator>
		<pubDate>Wed, 18 Mar 2009 10:00:44 +0000</pubDate>
		<guid isPermaLink="false">http://evolve.reintroducing.com/?p=246#comment-3153</guid>
		<description>Hello:

var nums:Array = [&quot;ZERO&quot;,&quot;ONE&quot;,&quot;TWO&quot;,&quot;THREE&quot;,&quot;FOUR&quot;,&quot;FIVE&quot;,&quot;SIX&quot;,&quot;SEVEN&quot;,&quot;EIGHT&quot;,&quot;NINE&quot;];

Could I ask if evt.keyCode is inside key:Object = new Object(); 

or the number of elements inside key

Thanks for all and sorry my bad english</description>
		<content:encoded><![CDATA[<p>Hello:</p>
<p>var nums:Array = ["ZERO","ONE","TWO","THREE","FOUR","FIVE","SIX","SEVEN","EIGHT","NINE"];</p>
<p>Could I ask if evt.keyCode is inside key:Object = new Object(); </p>
<p>or the number of elements inside key</p>
<p>Thanks for all and sorry my bad english</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JP DeVries</title>
		<link>http://evolve.reintroducing.com/2008/11/21/tips-n-tricks/flash-key-codes/comment-page-1/#comment-2823</link>
		<dc:creator>JP DeVries</dc:creator>
		<pubDate>Fri, 13 Feb 2009 19:48:06 +0000</pubDate>
		<guid isPermaLink="false">http://evolve.reintroducing.com/?p=246#comment-2823</guid>
		<description>@Zevan,

Ah, using ActionScript to write ActionScript, I like your style ;)</description>
		<content:encoded><![CDATA[<p>@Zevan,</p>
<p>Ah, using ActionScript to write ActionScript, I like your style <img src='http://evolve.reintroducing.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Przybylski</title>
		<link>http://evolve.reintroducing.com/2008/11/21/tips-n-tricks/flash-key-codes/comment-page-1/#comment-2780</link>
		<dc:creator>Matt Przybylski</dc:creator>
		<pubDate>Wed, 04 Feb 2009 22:09:35 +0000</pubDate>
		<guid isPermaLink="false">http://evolve.reintroducing.com/?p=246#comment-2780</guid>
		<description>cool, i&#039;ll try to get it done soon, i&#039;ve just had small projects pop up out of the blue here and there and they all seem to have to be done in like two days time :P</description>
		<content:encoded><![CDATA[<p>cool, i&#8217;ll try to get it done soon, i&#8217;ve just had small projects pop up out of the blue here and there and they all seem to have to be done in like two days time <img src='http://evolve.reintroducing.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JP DeVries</title>
		<link>http://evolve.reintroducing.com/2008/11/21/tips-n-tricks/flash-key-codes/comment-page-1/#comment-2779</link>
		<dc:creator>JP DeVries</dc:creator>
		<pubDate>Wed, 04 Feb 2009 22:06:56 +0000</pubDate>
		<guid isPermaLink="false">http://evolve.reintroducing.com/?p=246#comment-2779</guid>
		<description>I&#039;ll let you finish ;)
If I get need it desperately before you post the final one I&#039;ll let you know...
Thanks</description>
		<content:encoded><![CDATA[<p>I&#8217;ll let you finish <img src='http://evolve.reintroducing.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
If I get need it desperately before you post the final one I&#8217;ll let you know&#8230;<br />
Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Przybylski</title>
		<link>http://evolve.reintroducing.com/2008/11/21/tips-n-tricks/flash-key-codes/comment-page-1/#comment-2778</link>
		<dc:creator>Matt Przybylski</dc:creator>
		<pubDate>Wed, 04 Feb 2009 21:12:42 +0000</pubDate>
		<guid isPermaLink="false">http://evolve.reintroducing.com/?p=246#comment-2778</guid>
		<description>I actually did make one that I now use just didn&#039;t post it yet.  I was going to wait until I got some time to write some methods in there for using multiple keys at once and all that so its all wrapped in one class, but if you want it now I can post what I have so far and then just version it out later.</description>
		<content:encoded><![CDATA[<p>I actually did make one that I now use just didn&#8217;t post it yet.  I was going to wait until I got some time to write some methods in there for using multiple keys at once and all that so its all wrapped in one class, but if you want it now I can post what I have so far and then just version it out later.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zevan</title>
		<link>http://evolve.reintroducing.com/2008/11/21/tips-n-tricks/flash-key-codes/comment-page-1/#comment-2777</link>
		<dc:creator>Zevan</dc:creator>
		<pubDate>Wed, 04 Feb 2009 19:56:47 +0000</pubDate>
		<guid isPermaLink="false">http://evolve.reintroducing.com/?p=246#comment-2777</guid>
		<description>@JP 

no need for typing skills.... you can simply do something like this:
var alphabet:Array = &quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&quot;.split(&quot;&quot;);
var nums:Array = [&quot;ZERO&quot;,&quot;ONE&quot;,&quot;TWO&quot;,&quot;THREE&quot;,&quot;FOUR&quot;,&quot;FIVE&quot;,&quot;SIX&quot;,&quot;SEVEN&quot;,&quot;EIGHT&quot;,&quot;NINE&quot;];
for (var i:int  = 0; i&lt;alphabet.length; i++)
	 trace(&quot;public static const &quot;+ alphabet[i] + &quot;:int = &quot; + (65 + i) + &quot;\n&quot;);  
	 
for (i = 0; i&lt;nums.length; i++){
	 trace(&quot;public static const &quot;+ nums[i] + &quot;:int = &quot; +(48 + i) + &quot;\n&quot;);  
}

use ActionScript to write the class for you...</description>
		<content:encoded><![CDATA[<p>@JP </p>
<p>no need for typing skills&#8230;. you can simply do something like this:<br />
var alphabet:Array = &#8220;ABCDEFGHIJKLMNOPQRSTUVWXYZ&#8221;.split(&#8221;");<br />
var nums:Array = ["ZERO","ONE","TWO","THREE","FOUR","FIVE","SIX","SEVEN","EIGHT","NINE"];<br />
for (var i:int  = 0; i&lt;alphabet.length; i++)<br />
	 trace(&#8221;public static const &#8220;+ alphabet[i] + &#8220;:int = &#8221; + (65 + i) + &#8220;\n&#8221;);  </p>
<p>for (i = 0; i&lt;nums.length; i++){<br />
	 trace(&#8221;public static const &#8220;+ nums[i] + &#8220;:int = &#8221; +(48 + i) + &#8220;\n&#8221;);<br />
}</p>
<p>use ActionScript to write the class for you&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
