[Flashcoders] registering Enter key along with mouse event

2009-01-22 Thread Mendelsohn, Michael
Hi list...

I have a sprite that should fire an event either when it's clicked, or
when it has focus and the spacebar or the enter key is pressed.  The
mouse click and the spacebar keyUp events (when the sprite has focus)
work fine, but the enter key won't fire the event.  Here's my if
statement.  Am I missing something?

private function myEvent(e:*):void {
if(e.type ==keyUp){
trace(e.keyCode);
// traces 32 for spacebar but nothing for enter key
}
if
((e.type==mouseUp)||((e.type==keyUp)(e.keyCode==32))||((e.type==k
eyUp)(e.keyCode==Keyboard.ENTER))) {

thanks,
- Michael M.

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


Re: [Flashcoders] registering Enter key along with mouse event

2009-01-22 Thread Eric E. Dolecki
Is this in the IDE? If so, you need to turn off keyboard shortcuts

On Thu, Jan 22, 2009 at 10:27 AM, Mendelsohn, Michael 
michael.mendels...@fmglobal.com wrote:

 Hi list...

 I have a sprite that should fire an event either when it's clicked, or
 when it has focus and the spacebar or the enter key is pressed.  The
 mouse click and the spacebar keyUp events (when the sprite has focus)
 work fine, but the enter key won't fire the event.  Here's my if
 statement.  Am I missing something?

 private function myEvent(e:*):void {
if(e.type ==keyUp){
trace(e.keyCode);
// traces 32 for spacebar but nothing for enter key
}
if
 ((e.type==mouseUp)||((e.type==keyUp)(e.keyCode==32))||((e.type==k
 eyUp)(e.keyCode==Keyboard.ENTER))) {

 thanks,
 - Michael M.

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




-- 
http://ericd.net
Interactive design and development
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] registering Enter key along with mouse event

2009-01-22 Thread Ivan Dembicki
Hello Michael,

Menu: Control - Disable Keyboard Shortcuts

-- 
iv
http://www.bezier.ru
http://bezier.googlecode.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] registering Enter key along with mouse event

2009-01-22 Thread Mendelsohn, Michael
Thanks Ivan and Eric.

I did have shortcuts disabled, but even with control|test movie, it seems the 
IDE still traps the enter key.  It worked when I launched the swf outside Flash 
altogether.

Thanks,
- MM


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