Timers and Clocks

getTimer

Timers for games meassure the amount of time the game has lasted. It requires some intermediate calculations.

To obtain the time information we use the flash native function getTimer()
This function measures the time since the Flash player started, which is different from the time since the game started (later).
The function measures time in milliseconds, so we will have to "translate the amount into minutes and seconds divided by a semicolon: the way humans like measuring time.

.

Showing a digital clock

The value of the variable timePassed contains time meassured in milliseconds.
Those are the steps to convert it into a digital clock format,
1. To compute minutes and seconds:

2. To format minutes and seconds into a clock string: