flash8 制作电子时钟问题
我想做一个电子时钟的flash,但测试时总是只出现 undefined.3
有两个图层,图层1是用来显示的两个动态文本框—ateTextField 和timetextfield),图层2就是脚本了
脚本代码如下:
第一帧:
newDate = new Date();
DateTextField = (newDate.getfullyear()+"."+(newDate.getMonth()+1)+"."
+newDate.getDate());
Cur_hour = newDate.getHours();
if (length(Cur_Hour)<2) {
Cur_Hour = "0"+Cur_Hour;
}
Cur_Minute = newDate.getMinutes();
if (length(Cur_Minute)<2) {
Cur_Minute = "0"+Cur_Minute;
}
Cur_Second=newDate.getSeconds();
if (length(Cur_Second)<2) {
Cur_Second = "0"+Cur_Second;
}
timetextfield = cur_hour+":"+cur_minute+":"+cur_second;
第二帧:
gotoAndPlay(1);
是哪里出了问题,各位大虾帮帮忙。。。。
[解决办法]
我有个现成的倒计时代码,发你看看吧
if (text2.text=="0") {
text2.text = "00";
}
if (text2.text=="00") {
if (int(text1.text)<10){
text1.text = "0"+String(int(text1.text));
}
text1.text=String(int(text1.text)-1);
text2.text="61";
text2.text=String(int(text2.text)-1);
}
if (int(text2.text)>0) {
text2.text=String(int(text2.text)-1);
if (int(text2.text)<10){
text2.text = "0"+String(int(text2.text));
}
if(int(text1.text)<10){
text1.text = "0"+String(int(text1.text));
}
if (int(text2.text)>=10){
text2.text = String(text2.text);
}
}