How to count time?

I’m currently making a game. when the user is finished I want the time to display. How do you make a simple counter that will keep proper time. What I came up with isn’t anywhere close.

You play the game by mousing overr the pixels. When u have caught all 42 the time displays and its game over. I would like the time to display in seconds.

Incrementing your time variable through the onClipEvent(enterFrame) causes it to increment at the framerate of your movie (24 in the case of yours). What you need to do instead is use the getTimer() function. Here’s your movie with a working timer. I hope it’s what you want.

There is a sample fla timer in your: Flash MX\Samples\FLA directory.

Should help ya out.:rambo:

Thanks kza. I knew the getTime thing but couldn’t get it working. Couldn’t remeber exactly how it went. Works perfect man thanks:)

I was glad to help. I had the same problem a couple weeks ago because I didn’t know about getTimer(). I know how frustrating it can be when all you need is a simple function.