dcsimg
A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: [CS3] Timer Not Counting Up

Threaded View

  1. #1
    Member
    Join Date
    Mar 2008
    Posts
    67

    [CS3] Timer Not Counting Up

    I'm trying to make a timer for a puzzle I made and I can't get it to count at all. I just get "0:0:0". Here's my code:

    Code:
    function oneUp() {
    	seconds++;
    	trace("interval called");
    }
    
    
    setInterval(oneUp,1000);
    
    
    stop();
    
    var seconds = 0;
    var minutes = 0;
    var hours = 0;
    
    timeDisplay = hours+":"+minutes+":"+seconds;
    
    if (seconds=60) {
    	seconds = 0;
    	minutes++;
    }
    if (minutes=60) {
    	minutes = 0;
    	hours++;
    }
    if (seconds<10) {
    	seconds = "0"+seconds;
    }
    if (minutes<10) {
    	minutes = "0"+minutes;
    }
    if (hours<10) {
    	hours = "0"+hours;
    }
    I also uploaded an example of what I got. Thanks in advance for any help.
    Attached Files Attached Files

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