自己按F1看flash 自带的帮助,里面就有一个例子
var my_timedProcess:Number = setTimeout(my_delayedFunction, 2000, "two second delay");
function my_delayedFunction (arg1) {
trace(arg1);
}
var escListener:Object = new Object();
escListener.onKeyDown = function() {
if (Key.isDown(Key.ESCAPE)) {
clearTimeout(my_timedProcess);
}
};
Key.addListener(escListener);