1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
| this.onEnterFrame = function(){
var today = new Date();
var currentYear = today.getFullYear();
var currentTime = today.getTime();
var targetDate = new Date(currentYear,2,13,15,0,0);
var targetTime = targetDate.getTime();
var timeLeft = targetTime - currentTime;
var sec = Math.floor(timeLeft/1000);
var min = Math.floor(sec/60);
var hrs = Math.floor(min/60);
var days = Math.floor(hrs/24);
sec = string(sec % 60);
if (sec.length < 2){
sec = "0" + sec;
}
min = string(min % 60);
if (min.length < 2){
min = "0" + min;
}
hrs = string(hrs % 24);
if (hrs.length < 2){
hrs = "0" + hrs;
}
days = string(days);
if (days.length < 2){
hrs = "0" + hrs;
}
var counter = days + ":" + hrs + ":" + min + ":" + sec;
time_txt.text = counter;
if (min=="00"){
if (sec=="03"){
c1 = new Sound();
c1.attachSound("1");
c1.start();
}
}else if (min=="15"){
if (sec=="03"){
c1 = new Sound();
c1.attachSound("1");
c1.start();
}
}else if (min=="30"){
if (sec=="03"){
c1 = new Sound();
c1.attachSound("1");
c1.start();
}
}else if(min=="45"){
if (sec=="03"){
c1 = new Sound();
c1.attachSound("1");
c1.start();
}
}
} |
Partager