# Interval parameters wont update

**URL:** https://forum.kirupa.com/t/interval-parameters-wont-update/175464
**Category:** Uncategorized
**Created:** [January 14, 2006, 6:53pm UTC](https://forum.kirupa.com/t/interval-parameters-wont-update/175464 "2006-01-14T18:53:19Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![unchew](https://avatars.discourse-cdn.com/v4/letter/u/7ba0ec/32.png) [@unchew](https://forum.kirupa.com/u/unchew)
#### Post date: [January 14, 2006, 6:53pm UTC](https://forum.kirupa.com/t/interval-parameters-wont-update/175464/1 "2006-01-14T18:53:19Z")

</div>

Hi, I have an interval that executes a function every certain amount of time. This time is supposed to be controled by a variable called “frecuencia”. The thing is, when I change the variable the interval will still use the same original value. How can I make the interval UPDATE after I change the variable?. Here is the code:

```auto
 
var Items = new Array(bombon, regalo, corazon);
pos = new Object();
pos._x=random(550);
i=0
itemspeed=5
frecuencia=1000
goal=10
function lvlup(){
 frecuencia-=200
 goal+=20
 level++;
}
function randomize (){
 targeta=Items[random(3)]
 pos._x=random(550);
 targeta.duplicateMovieClip("item"+i,i,pos);
 i++;
}
var Int = setInterval(randomize, frecuencia);

```

I am calling the function lvl up in a separate part.
