flash怎么获取系统时间并显示在动画中,本人新手,还望步骤详细点
2个回答
展开全部
//在场景中建立用个动态文本:分别为:year_txt,month_txt,date_txt,Xiaoshi_txt.();
Fen_txt. Miao_txt;xq_txt.下面是代码,你直接粘就可以了。这是3.0
addEventListener(Event.ENTER_FRAME,frame)
function frame(e){
var now:Date = new Date();
varnian:int=now.fullYear
varyue:int=now.month+1;
varri:int=now.date;
varxiaoshi:int=now.hours
varfen:int=now.minutes ;
varmiao:int=now.seconds
var xq:int=now.day
year_txt.text=nian.toString()
month_txt.text=yue.toString();
date_txt.text=ri.toString()
Xiaoshi_txt.text=xiaoshi.toString();
Fen_txt.text=fen.toString();
Miao_txt.text=miao.toString();
xq_txt.text="星期"+xq.toString ()
}
Fen_txt. Miao_txt;xq_txt.下面是代码,你直接粘就可以了。这是3.0
addEventListener(Event.ENTER_FRAME,frame)
function frame(e){
var now:Date = new Date();
varnian:int=now.fullYear
varyue:int=now.month+1;
varri:int=now.date;
varxiaoshi:int=now.hours
varfen:int=now.minutes ;
varmiao:int=now.seconds
var xq:int=now.day
year_txt.text=nian.toString()
month_txt.text=yue.toString();
date_txt.text=ri.toString()
Xiaoshi_txt.text=xiaoshi.toString();
Fen_txt.text=fen.toString();
Miao_txt.text=miao.toString();
xq_txt.text="星期"+xq.toString ()
}
追问
你好,是分别建立七个动态文本,然后在动作里贴上代码吗
追答
是,动态文本的名称一定要相同
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询