RE: [Flashcoders] Prevent space button passing click event tobutton (as3)

2009-12-02 Thread Paul Steven
Thanks Muzak - that appears to have done the trick. Nice one!!

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com 
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Muzak
Sent: 02 December 2009 12:02
To: Flash Coders List
Subject: Re: [Flashcoders] Prevent space button passing click event tobutton 
(as3)

Try:

gameMenuBtn.focusRect = false;

- Original Message - 
From: "Paul Steven" 
To: "'Flash Coders List'" 
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


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


Re: [Flashcoders] Prevent space button passing click event tobutton (as3)

2009-12-02 Thread Muzak

Try:

gameMenuBtn.focusRect = false;

- Original Message - 
From: "Paul Steven" 

To: "'Flash Coders List'" 
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