Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2005
    Posts
    1

    countDown problem

    Hi, i got this code of countDown and at "0" it`s not stop the elapse. it`s countDown with "-" . Can someone help me with it ? Thanks.
    Code:
    this.onEnterFrame = function() {
    
    var today:Date = new Date();
    var currentYear = today.getFullYear();
    var currentTime = today.getTime();
    
    var targetDate = new Date(currentYear,11,01,22,00,00);
    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);
    
    var counter:String = days + ":" + hrs + ":" + min + ":" + sec;
    time_txt.text = counter; //time_txt it`s the text box of the counter
    }

  2. #2
    Join Date
    Nov 2007
    Posts
    1
    check your code against the code in this tute

    http://www.entheosweb.com/Flash/vide...down_timer.asp
    Good fortune to everyone

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •