Flash ActionScript Key.isDown Command
March 1, 2005 12:13 PM
Subscribe
I have some ActionScript and I need to change the keyboard controls from the arrow keys (up, down, left and right) to a, z , comma and period but nothing seems to be working... Please hope me!
The code is as follows:
onClipEvent (enterframe) {
if (Key.isDown(key.DOWN) && _y < 100) { _y=_y+1; } if (key.isdown(key.up) && _y> 10 {
_y=_y-1;
}
if (Key.isDown(key.RIGHT) && _x < 200) { _x=_x+1; } if (key.isdown(key.left) && _x> 10) {
_x=_x-1;
}
I have tried replacing the DOWN, UP, RIGHT and LEFT with the letters alone, letters in quotes and the key codes listed in the Flash help file but nothing is working. What am I missing?
Note: Flash MX with ActionScript in Expert* Mode
* How ironic is that? :)>>
posted by stringbean to computers & internet (2 comments total)
where 85 is to be replaced with the keycode for the key you want (unless you already tried that in which case I've no idea).
posted by juv3nal at 12:30 PM on March 1, 2005