Flash As2 onKeyDown某些字符会取消键吗?
我正在恢复Flash AS2中的一些旧代码,并遇到此问题,如何取消一些字符的键盘发送?
例如:
keyListener = new Object();
keyListener.onKeyDown = function():Void
{
var pathFocus:String = Selection.getFocus();
var keynum = Key.getCode();
if (keynum > 122)
{
HOW TO CANCEL THE KEY PRESS
}
}
Key.addListener(keyListener);
在VB中很简单:
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii > 122 Then
KeyAscii = 0
End If
End Sub
预先感谢...