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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to have multiple timers??? 1

Status
Not open for further replies.

mrbens

Technical User
Apr 26, 2001
5
GB
Is it possible to have multiple timers going at the same time.

To my knowledge you can only use startTimer on one thing at any one time, what if you need to do 2 things simultanously which both need independant timers????

I need to do this, can anyone help me??
 
You have to use variables to keep track of the time you started checking the time and the current time.

something like

global gStartedCheckingAt

on beginsprite
gStartedCheckingAt = the milliseconds
end

on exitframe
timepassed = the milliseconds - gStartedCheckingAt
if timepassed >= the abount of time I want to wait then
do something
end if
end


this should work as a sprite or frame script.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top