Groups | Blog | Home
all groups > flash (macromedia) > november 2003 >

flash (macromedia) : different keystrokes to activate different scenes?


ianbentley
11/18/2003 10:48:11 PM
Is there a way to tell a scene or key frame to play on different keystrokes (for example, go to frame 1 when "k" is pressed, go to frame 50 when "g" is pressed, etc)... And if so, do you have an example or 2 that I can use in the actions panel - Thanks!!!

urami_
11/19/2003 8:16:38 AM


[quoted text, click to view]

of course , you can make multiple IF or IF ELSE statements and include all
possible combinations, you could even make arrays of keys ....
there is many ways ... just to give you rough idea

this.onKeyDown = function() {
if (Key.isDown(Key.LEFT)) {
// action here
trace("left key is down");
} else if (Key.isDown(Key.RIGHT)) {
// action here
trace("right key is down");
} else if (Key.isDown(Key.DOWN)) {
// action here
trace("DOWN key is down");
} else if (Key.isDown(Key.UP)) {
// action here
trace("UP key is down");
}
};
Key.addListener(this);



Regards

urami_*



<lsym>

There's no place like 127.0.0.1

Carl Fink
11/19/2003 9:54:32 AM
Adding to what others said, don't use scenes for navigation. They often don't
work once you convert to SWF. Instead, use frame labels or separate
movieClips.
--
Carl Fink
ianbentley
11/19/2003 12:44:32 PM
the second part of the question is will the keystrokes work when the flash movie is exported out to an .exe format?

also, can you give me one example instead of 5... I am a little confused (and if you don't mind, please include the example... if "g" is pressed, then go to frame 50)

Thanks!!!

AddThis Social Bookmark Button