Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 How can i use the keyboard in flash
Index -> Graphics and Design, Web Design -> Flash MX Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
nis




PostPosted: Tue Mar 09, 2004 4:31 pm   Post subject: How can i use the keyboard in flash

How do i make the computer reconize when the 'a' button is pressed or 'b' etc. I know how to use the arrow keys (Key.UP, Key.DOWN, etc) but how do i use the other keys? thanks
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Tue Mar 09, 2004 5:16 pm   Post subject: (No subject)

well the same way as Key.UP/DOWN, but instead you might have to use their ASCII values Confused
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
zylum




PostPosted: Tue Mar 09, 2004 8:20 pm   Post subject: (No subject)

yeah tony is right, you need to use ascii. here's a simple way to check what the ascii value of the last letter you pressed:

code:
onEnterFrame = function () {
        // checks if a is being pressed
        // if (Key.isDown(65)) {
        // trace("fun");
        // }
       
        // gives you the keyCode for the last letter you pressed
        trace(Key.getCode());
};


-zylum
nis#2




PostPosted: Thu Mar 11, 2004 5:04 pm   Post subject: (No subject)

Thanks
Display posts from previous:   
   Index -> Graphics and Design, Web Design -> Flash MX Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: