PDA

View Full Version : keypress control movie


heero
03-25-2007, 09:16 PM
Hi all,

I would like to control a movie and freeze all playing with a keypress, I tried this code on a keyframe in the timeline but doesn't work;

on (keyPress "s") {
stop();
}

Thank you in advance.

CamX
03-26-2007, 12:31 AM
function myOnKeyDown() {
if (Key.getCode() == 83) {
trace('pressed');
}
}
var myListener:Object = new Object();
myListener.onKeyDown = myOnKeyDown;
Key.addListener(myListener);