PDA

View Full Version : Making the "Esc" key do something.



lariat1997
May 12th, 2006, 02:18 PM
Hey all,

If I wanted the escape key to take me to a certain location in my flash file, what is the best way to do it?

lariat1997
May 12th, 2006, 04:03 PM
Ok, I can get my esc key to produce a trace function. But I want my esc key to bring me to another .swf file and unload the current file. I've produced the following code:

var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
if (Key.isDown(Key.ESCAPE)) {
loadMovieNum("intro.swf", 1);
unloadMovie(this);
}
};
Key.addListener(keyListener);

I can get the esc key to load the intro.swf movie, but I cannot get out of the current movie.

Any help would be greatly appreciated.