PDA

View Full Version : key down won't work!!!


sputnikinspace
04-02-2003, 12:40 PM
this is my code:

myListener = new Object
myListener.onKeyDown = function(){
if (Key.isDown(Key.DOWN)) {
trace("DOWN PRESSED");
}
if (Key.isDown(Key.UP)) {
trace("UP PRESSED");
}
if (Key.isDown(Key.LEFT)) {
trace("LEFT PRESSED");
}
if (Key.isDown(Key.RIGHT)) {
trace("RIGHT PRESSED");
}
if (Key.isDown(Key.ENTER)) {
trace("ENTER PRESSED");
}
}
Key.addListener(myListener)


Everything work like a charm accept the enter key that won't work why???

/sput

magicwand
04-02-2003, 04:21 PM
try opening them from browser
it should work.

sputnikinspace
04-02-2003, 06:13 PM
Thanks man!!! It worked...the only problem now is that I have to use it with a projector...don't know if that works...really hope so!

Thanks
cheers
/sput

pixelwit
04-02-2003, 07:00 PM
The enter key won't register in the testing environment because it's a "shortcut key" used to make the player play. To get around this test your movie, then go to the top menu and choose "Control" then choose "Disable Keyboard Shortcuts" then the next time you press the enter key you should see the correct trace statement.

-PiXELWiT
http://www.pixelwit.com

sputnikinspace
04-02-2003, 07:41 PM
Thank you pixelwit!!

So thats whats stopping it from working!!!... thanks a bunch!

cheers
/sput