I did search the forums better this time and found nothing on this particula topic - I’m trying to figure out how to have an event on multiple keypresses rather than just one. For example I have:
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
trace("LEFT IS PRESSED");
}
if (Key.isDown(Key.RIGHT)) {
trace("RIGHT IS PRESSED");
}
if (Key.isDown(Key.UP)) {
trace("UP IS PRESSED");
}
if (Key.isDown(Key.DOWN)) {
trace("DOWN IS PRESSED");
}
}
Ugh. That only screws up the entire thing. I have no idea what to do here and I’m inches away from freaking out :-/ I tried to turn it into a movie clip, but the thing is it had been working before when I just had it set to on (keyPress) - then when I tried to switch it around, nothing worked! The problem is - what am I supposed to turn into a movie clip - all I want to do is load text into a box when 2 keys are pressed! ahsdjfkgvkdlksjg
I’m really sorry - I don’t mean to come off as rude - I really do appreciate it and love all of you, I’m just not thinking straight and having a rough week, but I shouldn’t be taking it at on you wonderful folk - please don’t take me too seriously, and yes, THANK YOU.
Gah! I took it out of the button’s actionscript and put it on the main timeline and it’s working fine now. Man, it’s always the silliest things :-/ If only Flash would TELL you. But we couldn’t be so lucky!
Thank you immensely Claudio, RvGaTe, and deQue. I really appreciate it!
Why not try:
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT) and (Key.isDown(Key.RIGHT)) {
trace(“Left and right have been pressed?”);
}
is what what u wanted?
And I have it on the main timeline… I get “this script contains no errors” yet nothing happens when I test it… Does it need to be associated with a button? Or a movie clip?