In this chapter we will look at how to listen to keyboard input with and without creating an object and a constructor. We will use the methods of the Key object to build an interface that can be controlled by a user with a standard keyboard. The properties of the Key object are constants representing the keys most commonly used to control games. For a complete list of key code values, see Appendix B at the end of this book. We will first look at the conventions within ActionScript and touch on the issues of Object-Oriented Programming. We will then move to a few tutorials on keyboard input.
The Structure of ActionScript Code
Only keywords in ActionScript are case sensitive; with the rest of ActionScript, you can use upper and ...
Get Understanding Flash MX 2004 ActionScript 2 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.