PDA

View Full Version : Movie control with key buttons?


Jive Turkey
02-06-2009, 09:47 PM
Hello,

I would like to be able to control a movie by using buttons. For example, if I want to go forward or next, instead of pressing a button in the flash movie, I could press the 'Right Arrow' key on my keyboard to do the same thing. I want to give the user both options to use the buttons in the flash movie and to use their keyboard to navigate.

For example, what would I have to add to this code below to accomplish this?

forward.onPress = function() {
_root.current++;
loader.gotoAndPlay(1);
};

Any help will be greatly appreciated. Thanks!

fluffy mcduff
02-06-2009, 10:08 PM
forward.onPress = function() {
_root.current++;
loader.gotoAndPlay(1);
};

(this is assuming that youre using actionscript 2.0)
actually, forward isn't a key. if you want right to go to the next frame, i would recommend this:

Key.isDown(Key.RIGHT) = function() {
_root.nextFrame();
loader.gotoAndPlay(1);
};
does that help any?

Jive Turkey
02-09-2009, 04:14 PM
I tried pasting your code into my actionscript window, but says the code is not correct.