# Changing setInterval at different times

**URL:** <https://forum.kirupa.com/t/changing-setinterval-at-different-times/203702>\
**Category:** flash\
**Created:** [October 13, 2006, 9:11am UTC](https://forum.kirupa.com/t/changing-setinterval-at-different-times/203702 "2006-10-13T09:11:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![PeepingTom](https://avatars.discourse-cdn.com/v4/letter/p/9dc877/32.png) [@PeepingTom](https://forum.kirupa.com/u/PeepingTom)\
**Post date:** [October 13, 2006, 9:11am UTC](https://forum.kirupa.com/t/changing-setinterval-at-different-times/203702/1 "2006-10-13T09:11:42Z")

</div>

Hi,  
I am quite new to actionscripting - using flash 8

I am making a flash game. The object of the flash game is to use the mouse and dodge the beer bubbles.

to start with, the beer bubbles are released slowly, after 10 seconds i want the interval to decrease and the amount of beer bubbles to increase. my code is as follows:

if (cTime \<= 10000){  
setInterval (makeNewClipB, 1000);  
}

if (cTime \>= 10000){  
setInterval (makeNewClipB, 500);  
}

However, regardless of what the timer is at the bubbles are released at 500ms-

not sure if the method i am generate the bubbles has anything to do with it:

function makeNewClipB() {  
clearInterval(ranID);  
ran = (Math.random()\*2000)+1000;  
ranID = setInterval(makeNewClipB, 1000);  
newClip = \_root.attachMovie(‘bubble’, ‘bubble’+depth, depth++);  
allBubblesB.push(newClip);  
newClip.\_x = Math.random()\*Stage.width;  
newClip.\_y = 400;  
newClip.speed = (Math.random()\*10)+5;  
newClip.onEnterFrame = function() {  
this.\_y -= this.speed;  
};  
}

If someone can oint me in the right direction to get this working i would be very appreciative - i am starting to go mental :h:

my .fla is here www.people.aapt.net.au/martinkyla/gamev2.fla

Many Thanks

Tom
