These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Counter

corageous
Registered: Oct 4 2008
Posts: 5
Answered

I am looking for some help on placing a timer on a PDF that will count down from 30 seconds. I tried using the app.setTimeOut() method to delay my counter function in order to simulate a timer. It does not count down completely to zero. Any suggestions. The code is below.

function counter()
{

if (milisec<=0)
{
milisec=9
seconds-=1
}

if (seconds<=-1)
{
milisec=0
seconds+=1
}
else
{
milisec-=1
clock.value=seconds+"."+milisec
app.setTimeOut("counter()",100)
}

}

gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
See [url=http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/date_time_part3/]Working with date and time in Acrobat JavaScript Part 3[/url] by Thom Parker. It includes a count down timer.

George Kaiser