Settings | Sign in | Sign up

The author has 1 post.

【ActionScript】侦听键盘事件

Floor 1 巨大八爪鱼 12/4/10 15:59
当按下键盘上的K键时动态文本“h”中的数字加一:
var num:Number=0;
stage.addEventListener(KeyboardEvent.KEY_DOWN,onKey_Down);
function onKey_Down(evt:KeyboardEvent):void{
if (evt.keyCode == 75){
   num++;
   h.text = String(num);
}
}

Content converter:

Reply the post
Content:
User: You are currently anonymous.
Captcha:
Unclear? Try another one.