all groups > flash actionscript > november 2006 >
You're in the

flash actionscript

group:

quick question


quick question Newbie1234
11/28/2006 8:27:14 PM
flash actionscript:
quick question.

What is the actionscript for selecting a key on the keyboard such as 'down' arrow, and the movieclip moves to frame 60?

Re: quick question adam NO[at]SPAM blueapplestudio
11/28/2006 11:30:47 PM
The attached code should do it for you. In this case, it is advised that you
not use frame numbers, however. It is better practice to label frame number
60, and then, use gotoAndStop("FrameName") instead of gotoAndStop(60).

Take care.



//Creates a listener object.
lo = new Object();

//Takes the user to frame 60 when the down arrow is pressed.
lo.onKeyDown = function() {
if (Key.isDown(Key.DOWN)){
gotoAndStop(60);
};
}

Key.addListener(lo);
AddThis Social Bookmark Button