Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

setSeconds 1

Status
Not open for further replies.
Dec 24, 2001
857
GB
Is there a way I can use the setSeconds command and have it increase by 1 every second?

I want to start it on '0' so it shows how long the movie has been running. Using getSeconds is no good because it shows the second the minute is up to on your local machine.

Hopeully, if I can set it as 0 and have it increase by 1, I can then use getSeconds to show how many seconds have passed.

Does anyone know how to do this, or have an alternative method?...

Thanks
 
You need to use getTimer(). This will get the time (in milliseconds) since the movie started playing ... so to get the amount of seconds you could use:

seconds = Math.floor(getTimer()/1000)

That should give you a whole number.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top