Is there some kind of wait command for actionscripts?

i wanna know if theres a script that will make something wait a certain amount of time before continuing on with something… like for a hit test thing for example. if i wanted a number to increase when 2 things touch and did the scripting to do so, when they touch eachother the number whould raise really fast. Whouldnt there be a way to make it so when they touch the number will raise, wait however long i till it to, then raise again?

function fWait(){\rif (!_root.nStart){\r_root.nStart = getTimer();\r} else {\rif ((getTimer()-_root.nStart)>1000){\r_root.nStart = getTimer();\r_root.nCounter++;\r}\r}\r}\r\rwhen the ‘hit’ happens just call the function. the variable ‘_root.nCounter’ will increment once every second. just change the ‘1000’ to whatever time (in milliseconds) you would like to wait.\r:) \rjeremy

You can also check the setInterval function. It was made exactly for that. But you’ll have to define a function.\r\rpom 0]

well im really not that much of an expert with actionscripts and i dunno what the setinterval function thing is… so im lost ^^

It’s explained in the Actionscript Dictionnary. Very well by the way.\r\rpom 0]