Try:

gameMenuBtn.focusRect = false;

----- Original Message ----- From: "Paul Steven" <paul_ste...@btinternet.com>
To: "'Flash Coders List'" <flashcoders@chattyfig.figleaf.com>
Sent: Wednesday, December 02, 2009 11:51 AM
Subject: RE: [Flashcoders] Prevent space button passing click event tobutton 
(as3)


Thanks for the replies.

When you say "buttons are meant to be pressed like that" - do you mean that
it is standard practice to use the tab key to move between buttons and then
use the SPACE key to click it?

You are correct in assuming I have a game where there is a button on the
interface that allows the user to quit the game.

I have the following code on this button:

gameMenuBtn.addEventListener(MouseEvent.CLICK, clickGameMenuButton);

function clickGameMenuButton(event:MouseEvent) {

gotoAndStop("splash");
}

I was hoping there was just a simple way to prevent the SPACE key from
virtually clicking this button. I still want the user to be able to click it
with the mouse.

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to