troubleshooting Question

How to simulate a keypress in Flash actionscript 2.

Avatar of Thread7
Thread7 asked on
ProgrammingWeb DevelopmentAdobe Flash
2 Comments1 Solution4782 ViewsLast Modified:
I have the following code in my Flash AS2 project. The trace works fine and the trace tells me what key was pressed. What I need to do though is actually simulate the keypress. (I have a datagrid object and need to make the focus go down one on the list). So I want to simulate pressing key 38 but am not sure how.

KeyListener = new Object();
KeyListener.onKeyDown = function(){
trace("key pressed" + Key.getCode());

(Just a little background.  I have a third party drag&drop datagrid component.  It doesn't have anything built in to automatically scroll down with the scroll bar.  So I want to press  the down arrow for the user)
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros