Skip to content
Published March 5, 2013

In preparation for my upcoming tutorials for Flash (and other similar posts I have planned) I have just created a GitHub account! 🙂

GitHub seems to be all the rage for open source fans out there, so I’ve decided it will be the best place to host my various creations for anyone to use.

Link: https://github.com/cleod9

I will be uploading not just Flash, but coding examples in other languages as well such as C, C++, Java, JavaScript, PHP and potentially many more.

 

For starters, here’s an AS3 class for easy keyboard input management in Flash:

Source Code: https://github.com/Cleod9/AS3/tree/master/Key

I have created the above class to simplify keyboard input management in Flash. Back in the days of ActionScript 2.0, you used to only have to call one function to get the state of a key press. In AS3 it’s become a pain – you have to set up multiple events just to be sure of whether or not a key is currently held down. With my Key class, you simply initialize it and you’re done! Anywhere in your program you can type the simple words Key.isDown(keyCode) just like in AS2, and you’ll be able to get the state of any key without having to create a bunch of extra event mess. This is definitely one of the most useful pieces of code in all of my games (especially SSF2), since it completely centralizes key press management.

I will be adding many more utilities like this, so stay tuned for more updates!

5 Comments

  1. Greg Henderson Greg Henderson

    Finally, it’s here! 🙂

    • Greg Henderson Greg Henderson

      I’m still a little confused about the tutorials. Where do I start?

      • Greg McLeod Greg McLeod

        This post is in preparation for the tutorials (I’m using GitHub to host supporting files). I’ll be make sure it’s clear where to start by numbering them once I begin 😉

          • Greg McLeod Greg McLeod

            Yes of course, with practice it should naturally become easier. I’ll be talking about the difficulties in the tutorials as well.

Leave a Reply to Greg Henderson Cancel reply

Your email address will not be published. Required fields are marked *