flash as3.0点击一目标后文本框内的数字就加1

2024-12-21 13:16:32
推荐回答(1个)
回答1:

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