您好,是这样的: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); }}