Help with this plz

 

setInterval(keyCheck, 1000);
function keyCheck() {
 if (Key.isDown(74) and Key.isDown(77) and Key.isDown(70)) {
  trace("test");
 }
}

 

can some1 plz tell if should work and if not how i can fix it with the desired effect (i would like to see if the J & M & F keys are being hit at the same time, and if so trace “test”, well actually i want to go to another frame but thats easy)

That’s because there is no logical AND operator that’s called ‘and’ in Flash !?
AND is used as &&
OR is used as ||
NOT is used at !

So replace ‘and’ with ‘&&’ and see if it works :slight_smile:

actually, you can use the word ’ and ’ as well as the word ’ or '.

both work. :slight_smile:

Wow, I guess I learned something new :slight_smile: Thanks for pointing that out!

Btw, I think the code needs a Listener to listen to which key is pressed…well, at least, I think :wink: