Maybe someone can help me figure this out...
Below is my code. It is a movie to detect keypresses. Basically what it is intended to do is the following:
-if a person presses Ctrl/C (nested below), Q1=correct.
-If a person presses anything but that combo, Q1 is incorrect.
This means I have to check first for any key press other than ctrl, and mark that as incorrect.
The tricky part is then tracking if the person does hit ctrl, I have to make sure that everything but ctrl followed by c is incorrect (ei, ctrl/a, ctrl/b, ctrl/d are all incorrect - only ctrl/c is correct).
Any ideas on how to do this? Seems like when I nest the two key downs and add and else statement, the second keydown is ignored. Below is my script:
onClipEvent (keyDown) {
pressed = Key.getCode();
if (Key.isDown(17)) {
if (Key.isDown(88)) {
_root.Q1 = "true";
_root.NextFrame();
}
}
}
Thanks!
Below is my code. It is a movie to detect keypresses. Basically what it is intended to do is the following:
-if a person presses Ctrl/C (nested below), Q1=correct.
-If a person presses anything but that combo, Q1 is incorrect.
This means I have to check first for any key press other than ctrl, and mark that as incorrect.
The tricky part is then tracking if the person does hit ctrl, I have to make sure that everything but ctrl followed by c is incorrect (ei, ctrl/a, ctrl/b, ctrl/d are all incorrect - only ctrl/c is correct).
Any ideas on how to do this? Seems like when I nest the two key downs and add and else statement, the second keydown is ignored. Below is my script:
onClipEvent (keyDown) {
pressed = Key.getCode();
if (Key.isDown(17)) {
if (Key.isDown(88)) {
_root.Q1 = "true";
_root.NextFrame();
}
}
}
Thanks!