level 7
不想去下载复杂的计时器,于是花十分钟做了一个“一分钟”倒计时的计时器,因为只需要一分钟而已。。。
功能:
1.倒计时开始
2.重置
3.到点发声提醒
2014年08月14日 12点08分
1
level 7
button "Reset"中的代码如下
on mouseUp
put 60 into field "time"
end mouseUp
作用是将field “time”中的值还原为60
button "Start"中的代码如下
on mouseUp
sTime
end mouseUp
on sTime
if field "time" is 0 then
play specialFolderPath("engine") & "/da.mp3"
else
subtract 1 from field "time"
send "sTime" to me in 1 second
end if
end sTime
sTime自定义命令使用send命令向自己发送message,通过这种方法实现不断将field "time"中的值每隔一秒就减1的效果,直到field "time"中的值为0,播放声音,这里音频文件需要满足两个条件(只针对上面的代码):
1.与stack文件存在同一文件夹下(与路径有关)
2.音频要导入到应用中
就那么多,简单之极啊有木有
2014年08月14日 14点08分
3