You need to do a listener for the keyboard and then check what key was pressed
by tracing its keyCode value. Then do an if statement seeing if the keycode
pressed is equal to the Enter key keycode and then run your code that will
execute just like if the viewer clicked the movieclip.
Hth.
--Original Message--
From: Alan Neilsen
Sender: flashcoders-boun...@chattyfig.figleaf.com
To: 'flashcoders@chattyfig.figleaf.com'
ReplyTo: Flash Coders List
Subject: [Flashcoders] Enter key to activate focused button
Sent: Dec 13, 2009 9:22 PM
I have set up a custom Tab order, so the Tab key moves through the interactive
elements (buttons) of my SWF in the order I want. I then want the Enter key to
execute the code for whichever button has focus (as if that button was
clicked). I can't work out how to add a listener that listens for the Enter key
to be pressed and then execute the code the button (as suggested by Karl:
thanks). Can anybody provide a code snippet for this?
I have tried to find a solution in the online help system for Flash, but that
system is sadly lacking. For instance, if I select "This Help system only" and
do a search for addEventListener I get no results - which seems ludicrous to
me. How is it possible that the term addEventListener does not exist anywhere
in the Flash Help system?
Alan Neilsen
This message is for the named person’s use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or; lost by any mistransmission. If
you receive this message in error, please immediately delete it and all
copies of it from your system, destroy any hard copies of it and notify
the sender. You must not directly or indirectly, use, disclose,
distribute, print or copy any part of this message if you are not the
intended recipient. GOULBURN OVENS INSTITUTE OF TAFE and
any of its subsidiaries each reserve the right to monitor all e-mail
communications through its networks. Any views expressed in this
message are those of the individual sender, except where the
message states otherwise and the sender is authorised to state them
to be the views of any such entity.
#
This e-mail message has been scanned for Viruses and Content and cleared
by MailMarshal
#
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Nathan Mynarcik
Interactive Web Developer
nat...@mynarcik.com
254.749.2525
www.mynarcik.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders