超简单的闹钟程序,相信你自己就可以看懂的

var myhour:Number;
var myminute:Number;
var mysecond:Number;
//设定闹钟信息
var mynaozhong:Object={h:16,m:11,info:”时间到,该起床了!”};
txt_shezhi.text=mynaozhong.h+”时”+mynaozhong.m+”分”;
stage.addEventListener(Event.ENTER_FRAME,_gettime);
function _gettime(e:Event):void {
var mydate:Date=new Date();
myhour=mydate.getHours();
myminute=mydate.getMinutes();
mysecond=mydate.getSeconds();
txt_current.text=myhour+”时”+myminute+”分”+mysecond+”秒”;
if (myhour==mynaozhong.h&&myminute==mynaozhong.m) {
txt_jieguo.text=mynaozhong.info;
}
}

    博视界科技专注于沉浸式全景数字餐厅、全息酒店宴会厅,旨在帮传统餐饮用科技玩跨界,欢迎咨询!

官方网站:www.boseetech.com

联系方式:    

关注我们:


    【声明】转载本文请注明出处三人行设计,并保留有效链接:[flash AS3实例教程]超简单的闹钟程序 http://www.srxtuan.com/archives/1028,谢谢!