# Holding movieclips

**URL:** <https://forum.kirupa.com/t/holding-movieclips/283930>\
**Category:** flash\
**Created:** [March 12, 2009, 4:33pm UTC](https://forum.kirupa.com/t/holding-movieclips/283930 "2009-03-12T16:33:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lilleypants](https://avatars.discourse-cdn.com/v4/letter/l/f17d59/32.png) [@lilleypants](https://forum.kirupa.com/u/lilleypants)\
**Post date:** [March 12, 2009, 4:33pm UTC](https://forum.kirupa.com/t/holding-movieclips/283930/1 "2009-03-12T16:33:25Z")

</div>

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:

```auto
function waitBLUE() {                
	exitBlue();
	trace("waiting blue 2");
	_global.blueCustomerMoveUP = false;
	_global.blueCustomerMoveDown = false
    clearInterval(myTimerBLUE);
}

```

Starting the Wait:

```auto
if (this.hitTest(startHit_mc)){
	myTimerBLUE = setInterval(waitBLUE, 3000) 
	waitBLUE(3);
}

```

Then to clear the wait if clicked:

```auto
blueCustomer_mc.onPress = function() {
clearInterval(myTimerBLUE);
};

```
