# setInterval() problems

**URL:** <https://forum.kirupa.com/t/setinterval-problems/156614>\
**Category:** flash\
**Created:** [July 27, 2005, 12:50am UTC](https://forum.kirupa.com/t/setinterval-problems/156614 "2005-07-27T00:50:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Breen](https://avatars.discourse-cdn.com/v4/letter/b/e79b87/32.png) [@Breen](https://forum.kirupa.com/u/Breen)\
**Post date:** [July 27, 2005, 12:50am UTC](https://forum.kirupa.com/t/setinterval-problems/156614/1 "2005-07-27T00:50:16Z")

</div>

I know it’s a rather stupid problem, but i can’t seem to get my function to work, i have the following code, just an abstract peace of code, works beautifully:

```auto
 
PlaatsDAO.getInstance().getItems(cb_plaatsenBezet, _global.ticketArr[0], this);

```

But i want this executed every 2 seconds, so i replaced it with:

```auto
checkSeats = function () {
PlaatsDAO.getInstance().getItems(cb_plaatsenBezet, _global.ticketArr[0], this);};
setInterval(checkSeats, 2000);

```

Now, this didn’t work, thinking that it was a scope problem, i replace my code with the following:

```auto
checkSeats = function () {
PlaatsDAO.getInstance().getItems(this._parent.cb_plaatsenBezet, _global.ticketArr[0], this._parent);
setInterval(checkSeats, 2000);

```

**Anyone have an idea as to what i’m doing wrong? thx**
