主题:  Re:ClickOn and DoubleClick

sAvage.Tang

职务:普通成员
等级:1
金币:0.0
发贴:26
注册:2001/7/10 20:09:16
#12001/7/10 21:47:41
经过调试通过:“鼠标单击执行语句1,若双击则执行语句2”
第一帧:

global clicknum
on exitframe me
clicknum=0
set timeoutMouse=true
end

第二帧:(画一个按钮)
global clicknum
on mouseUP me
clicknum=clicknum+1
end

on mouseLeave me
clicknum=0
end

on exitframe me
if the timeoutLapsed<=20 then
if clicknum=2 then
clicknum=0
set timeoutMouse=true
go frame "doubleclick"
end if
else if clicknum=1 then
clicknum=0
set timeoutMouse=true
go frame "click"
end if
end

非常抱歉前两次公开的程序是不正确的,这次已经通过测试。其中timeoutLapsed=20是记时器,判断两次鼠标按下之间的间隔时间,数字越小,双击就越困难。

最后谢谢大家来看我的帖子,若有错误还请各路高手多多指教!



cx

职务:普通成员
等级:1
金币:0.0
发贴:49
注册:2001/4/8 20:33:41
#22001/7/11 7:09:03
thanks

编辑历史:[这消息被cx编辑过(编辑时间2001-07-11 07:10:25)]


cx

职务:普通成员
等级:1
金币:0.0
发贴:49
注册:2001/4/8 20:33:41
#32001/7/11 22:14:15
上面的真对多个按钮,还是不行,不过我以解决:
on mouseUp
    if the doubleClick then exit
    startTimer
    repeat while the timer < 20
        if the mouseDown then
            doubleClickAction
            exit
        end if
    end repeat
    singleClickAction

end mouseUp


谢谢各位朋友的帮助



sAvage.Tang

职务:普通成员
等级:1
金币:0.0
发贴:26
注册:2001/7/10 20:09:16
#42001/7/11 23:50:45
这段程序已经通过测试了?我的办法可能比较笨拙,呵呵~~~