# \[as2\] Timer Help

**URL:** <https://forum.kirupa.com/t/as2-timer-help/306815>\
**Category:** flash\
**Created:** [March 22, 2010, 10:57pm UTC](https://forum.kirupa.com/t/as2-timer-help/306815 "2010-03-22T22:57:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Swamp7hing](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@Swamp7hing](https://forum.kirupa.com/u/Swamp7hing)\
**Post date:** [March 22, 2010, 10:57pm UTC](https://forum.kirupa.com/t/as2-timer-help/306815/1 "2010-03-22T22:57:38Z")

</div>

Hey everyone, I’m new here (as you can probably tell by my post count).  
I figure it’s useful to be a member of a flash code/development site, so I’ve created an account here. Hope to get to know you all!

Anyways, on to the meat of my topic. I’ve been developing a flash game with a friend, and have hit a minor snag with the timers. My entire game runs in one frame, spawning movieclips and handling all that game-related stuff.

Thing is, I’ve got a timer that spawns one thing (a boulder, in case anyone is wondering), and I’d like to have that setInterval (milliseconds) decrease every second by a set amount.

The important snippet of my code looks like this:

```php

var timeb = 750;
bfalltimer = function () {
	spawnboulders();
	if (gaslevel<=0) {
		clearInterval(boulderspawntime);
	}
};
boulderspawntime = setInterval(bfalltimer, timeb);

```

Every second, I’d like timeb to decrease. I’ve tried everything I can think of - did I miss anything? How would I properly do this?

Thanks in advance to anyone who replies and/or reads this far.

- Swamp
