Forum Moderators: open

Message Too Old, No Replies

Simple key press code for Flash movie

How do you get flash to respond to a key press?

         

chriswragg

2:41 pm on Jun 12, 2005 (gmt 0)

10+ Year Member



What I want to do is to gotoAndplay a frame when a button is pressed. I tried using Key.getCode() but had little success. I wonder is anyone else can help.

I would prefer to use a key such as spacebar to activate the script.

Help would be appreciated

Chris

Richard_N

8:21 pm on Jun 13, 2005 (gmt 0)



key strokes can only be assigned to a button instance not held on the main timeline.

You need to have a button instance just off screen and attach it to that.

example

on(keyPress "<left>") {
nextframe();
}