PDA

View Full Version : Create a timer?


c_knights
03-18-2005, 08:21 AM
My next problem is this: how do I create a simple timer that counts up from 0 indefinitely (although in reality, I probably won't need it to go above 30 mins)?

I had been using getTimer, but I've now discovered that I don't want the timer to start from when the swf file loads, but from from when the second frame enters (the first frame is the main menu of my game and the second frame contains level one of the game).

Someone suggested to me setting the frame rate of a movie clip to 1fps and setting a variable to increment by one on each enter frame. However, I don't want the rest of my game to run at 1fps so is there a better way of achieving the timer effect using, say, getSeconds? I've tried a couple of things with this but am having trouble getting it to work properly.

Xeef
03-18-2005, 10:38 AM
take a search

i was helping on this in the last week 2-3 times in difereny threads
PLS search
if you realy not find them post back

tg
03-18-2005, 03:09 PM
var starttime=getTimer() // put this where you want to start tracking time
var elapstedTime=getTimer()-starttime; // put this where you want to know the time.