2006/01/16 | actionscript鼠标停止几秒后的动作
类别(Flash学习) | 评论(0) | 阅读(218) | 发表于 09:33
actionscript鼠标停止几秒后的动作代码

var mouseListener:Object = {};
var stillFor = 5000//停止的时间,你可以自己定义
mouseListener.onMouseMove = function ():Void {
if (this.timer) {
clearInterval (this.timer);
        trace("你的鼠标动了");
//your code here:
//what to do onMouseMove
}
this.timer = setInterval (_root, "mouseTimeout", stillFor, this);

};
Mouse.addListener (mouseListener);
function mouseTimeout (listener:Object):Void {
clearInterval (listener.timer);
trace("你已停止5秒了");
    //your code here:
//what to do after 5 sec (stillFor) of mouse inactivity
}
0

评论Comments