dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [F8] Countdown issues....

  1. #1
    Member
    Join Date
    Jul 2005
    Posts
    63

    [F8] Countdown issues....

    I'm creating a countdown for a presentation that my team at work should be using. it does not need to be 100% clock accurate, since we're just looking for a rough amount of time until a presentation starts. i'm having trouble with "-1" appearing, and also the text blinking out from time to time. can someone direct me to how i can fix this? thanks....
    Attached Files Attached Files

  2. #2
    Ryan Thomson EvolveDesigns's Avatar
    Join Date
    Oct 2001
    Location
    British Columbia
    Posts
    3,338
    gotta go but i made a couple changes to your code, try it out:

    PHP Code:
    var seconds:Number = new Number ();
    var 
    minutes:Number = new Number ();

    minutesText._visible false;
    secondsText._visible false;


    function 
    countDown () {
        
    seconds --;
        
    secondsText.text seconds;
        
    minutesText.text minutes;
        if (
    seconds 0) {
            
    seconds 59;
            
    minutes --;
            
    minutesText.text minutes;
        }
        if (
    seconds <= 9) {
            
    secondsText.text "0"+seconds;
        }
        if (
    minutes <= 9) {
            
    minutesText.text "0"+minutes;
        }
        if (
    seconds == && minutes == 0) {
            
    clearInterval(intervalId);
        }
    }

    min20_btn.onRelease = function () {
        
    minutes 19;
        
    seconds 59;
        
    minutesText._visible true;
        
    secondsText._visible true;
    }

    min15_btn.onRelease = function () {
        
    minutes 14;
        
    seconds 59;
        
    minutesText._visible true;
        
    secondsText._visible true;
    }

    min10_btn.onRelease = function () {
        
    minutes 13;
        
    seconds 59;
        
    minutesText._visible true;
        
    secondsText._visible true;
    }

    min05_btn.onRelease = function () {
        
    minutes 04;
        
    seconds 59;
        
    minutesText._visible true;
        
    secondsText._visible true;
    }

    min01_btn.onRelease = function () {
        
    minutes 00;
        
    seconds 59;
        
    minutesText._visible true;
        
    secondsText._visible true;
    }

    intervalId setInterval(countDown1000); 
    Evolve Designs Interactive Media
    the natural selection

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center