I’m sure there is a simple fix, but this is my first attempt to create a Flash Menu that supports both Mouse and keyboard input.
I’ve created a simple Flash based menu (ONE frame, 7 layers) with a Keylistener on the first frame of my “background” layer. I have it setup with six links/buttons. Clicking a button opens that URL. And in “Test” mode from the Flash Editor, pressing 1 thru 6 on the keyboard launches the specified link as well.
But after I publish/upload my file, it no longer detects any keystrokes. I suspected this was because the animation was playing just one frame and stopping, but the animation is set to loop. I also tried adding a second frame and adding a “gotoandplay(1);”, but that didn’t work either.
I seem to remember running into a problem like this before but can’t remember what the solution was. Anyone?
KeyListener = new Object();
var myKey;
KeyListener.onKeyDown = function() {
myKey = Key.getAscii();
if (myKey == 49) getURL("http://aaaaa.com"); // Typed the "1" key.
if (myKey == 50) getURL("http://bbbbb.com");
if (myKey == 51) getURL("http://cccccc.com");
}
Key.addListener(KeyListener);