First a caveat: I's a bad idea. Pressing enter to submit an entire form and spacebar to click a specific button is a fairly standard UI practice, and something you shouldn't change without a good reason.
But if you've got your heart set on it, one option is to subclass Button, put your code in there and use <package:MyButton> in place of <mx:Button>. Or, depending on how you're going about it you could probably add a listener to keyUp on systemManager, check for somebody pressing enter when the target is a Button, and then simulating a click programmatically. That's assuming keyUp bubbles, I have no idea if it does :) -Josh On Sat, Jun 28, 2008 at 3:25 AM, dnk <[EMAIL PROTECTED]> wrote: > Good day all, > > How would one go about enabling the enter key for all buttons in your > flex app? > > I know you an do the defaultKey for a form, or add keyDown to your > button (but that reacts to all keys then - not good). > > As it stands now, the spacebar will react to every button onFocus.. .I > was hoping to do that with the Enter key... > > d > > > > ------------------------------------ > > -- > Flexcoders Mailing List > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > Search Archives: > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups > Links > > > > -- "Therefore, send not to know For whom the bell tolls. It tolls for thee." :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]