PDA

View Full Version : anykey press



00r00
August 20th, 2003, 10:02 AM
hi, I need a code

...

if any key is pressed the movie must go to the specified frame, if not stop

thanxs

Maxtr0sity
August 20th, 2003, 10:07 AM
Welcome to the forums 00r00.

00r00
August 20th, 2003, 10:11 AM
thanx

Ranoka
August 20th, 2003, 11:23 AM
Welcome :)

I still can't find the anykey...

aussy
August 20th, 2003, 11:45 AM
INsert a moveiclip titled "mouse actions" or "mouse control" or something like that. Now put these actions on the movie clip...


onClipEvent (keyDown) {
gotoAndPlay(2);
}
onClipEvent (keyUp) {
stop();
}

I tihnk that's what you wanted. If you wanted it to not stop in the middle of a frame when teh key is released, just get rid of that part of teh code and place a stop action at the frist frame. I tihnk you can figure out how that code works.

:p: aussy

claudio
August 20th, 2003, 12:22 PM
Place this on the main timeline.myListener = {onKeyDown:function () {
_root.gotoAndStop(2);
}};
Key.addListener(myListener);