Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 4 of 4

Thread: Timer countdown

  1. #1
    Join Date
    May 2008
    Location
    The Netherlands
    Posts
    109

    Timer countdown

    can someone help me with this script? i want it to count down but not rely on systemtime

    ON PRELOAD
    Code:
    bRunning = true;
    nTimerResolution = 60; -- In miliseconds
    nMillisecs = 0;
    nSeconds = 0;
    nMinutes = 5;
    nHours =0;
    
    
    Page.StartTimer(60)		
    
    
    function UpdateTimerTime()
    
    	if(nMillisecs >= 1000) then
    		nSeconds = nSeconds + 1;
    		nMillisecs = 0;
    	end
    
    	local nTenths = Math.Round(nMillisecs / 100, 1) * 10;
    
    	if(nSeconds > 59) then
    		nMinutes = nMinutes + 1;
    		nSeconds = 0;
    	
    end
    	if(nMinutes > 59) then
    		nHours = nHours + 1;
    		nMinutes = 0;
    	end
    _at_comp = nHours*3600+nMinutes*60+nSeconds+nMillisecs*1000;
    	
    	local strElapsed = string.format( "%.2d:%.2d"
    	                                , nMinutes
    	                                , nSeconds );
    end
    	
    	Input.SetText("Time", strElapsed)
    ON TIMER
    Code:
    nMillisecs = nMillisecs + nTimerResolution;
    UpdateTimerTime();
    and i've tried the search function but i can't find an instant countdown timer

  2. #2
    Join Date
    Aug 2003
    Posts
    2,427
    I posted a timer here a while back.

  3. #3
    Join Date
    May 2008
    Location
    The Netherlands
    Posts
    109
    but i want it to countdown

  4. #4
    Join Date
    Jul 2002
    Location
    Just South of Reality
    Posts
    778
    Quote Originally Posted by limboo View Post
    but i want it to countdown
    Here's a very simple countdown ap that may give you some ideas for your project.
    Attached Files

Similar Threads

  1. Example: Technique for Multiple timer events
    By holtgrewe in forum AutoPlay Media Studio 7.5 Examples
    Replies: 12
    Last Post: 08-08-2008, 10:15 AM
  2. Corey, about that flash countdown timer you posted...
    By element78 in forum AutoPlay Media Studio 4.0
    Replies: 10
    Last Post: 09-30-2003, 08:35 PM
  3. Using Timer Events
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 09-22-2003, 02:14 PM
  4. A countdown timer for your projects...
    By Corey in forum AutoPlay Media Studio 4.0
    Replies: 1
    Last Post: 07-30-2003, 09:50 AM
  5. Replies: 14
    Last Post: 06-24-2003, 04:21 AM

Posting Permissions

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