PDA

View Full Version : keyboard input



autumnmedia
March 10th, 2009, 01:08 PM
hi,
this is my current code

if(String.fromCharCode(e.keyCode) == 'R') {

what i need is where the R is to pass in a var

i tried


if(String.fromCharCode(e.keyCode) == (words[letterDrop])) {
where letterDrop is a number

any ideas

muhammadzubair
March 10th, 2009, 02:13 PM
What is "words" ? And are you sure that letterDrop must not be 'NaN' (Not a Number)?

autumnmedia
March 10th, 2009, 04:28 PM
words is an array, that holds letters, so i want it to call a letter from that array