Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simulate KeyBoard with ActionScript and Flash

Status
Not open for further replies.

vvicin01

Programmer
Aug 14, 2001
21
0
0
US
I need some actionscript to create keyboard commands - such as the enter, tap and character keys. Are there any scripts that will allow me to do this?

Thanks
 
just alter to suit for the keys you wish to trap

var myKeyListener = new Object();
myKeyListener.onKeyUp = function() {
switch (key.getCode()){
case 13:
trace("enter");
break;
case 37:
trace("left")
break;
case 39:
trace("right")
break;
}
}
Key.addListener(myKeyListener);
stop();
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top