Forum Moderators: open

Message Too Old, No Replies

Flash Problem using keyboard keys

how to jump to a frame using any key of the keyboard?

         

brutjens

9:19 am on Oct 14, 2005 (gmt 0)

10+ Year Member



Hi there,

i have a problem with flash.

I want to jump from one frame to another using keys of the keyboard.
It is working using a specified key with the following code:

on(keyPress "b") {
gotoAndPlay(19);
}

My problem is now, that i want to use it without specifying a key, so it will work for any key i use...

Is there someone who can help me with this problem?

Thanks!
Grtz, Bert

Richard_N

5:14 pm on Oct 14, 2005 (gmt 0)



myListener = new Object();
myListener.onKeyDown = function(){
gotoAndStop(19);
}
Key.addListener(myListener);

brutjens

8:33 am on Oct 15, 2005 (gmt 0)

10+ Year Member



Thanks a lot!

I solved the problem with a movie clip and the following code:

onClipEvent (keyDown) {
this._parent.gotoAndPlay("118");
}

But thanks for your reaction!

Grtz, Bert