What is the best way to have a timer on individual movieclips?
At the moment I have 3 movieclips and when they hit a hitTest I need a 3 second counter to count down. I was using set interval but I need it so that if the user clicks the movieclip before the 3 seconds it clears the timer! I’ve used the following code that doesn’t seem to work - any help would be great.
The Wait:
function waitBLUE() {
exitBlue();
trace("waiting blue 2");
_global.blueCustomerMoveUP = false;
_global.blueCustomerMoveDown = false
clearInterval(myTimerBLUE);
}
Starting the Wait:
if (this.hitTest(startHit_mc)){
myTimerBLUE = setInterval(waitBLUE, 3000)
waitBLUE(3);
}
Then to clear the wait if clicked:
blueCustomer_mc.onPress = function() {
clearInterval(myTimerBLUE);
};