# Losing class scope with setInterval

**URL:** https://forum.kirupa.com/t/losing-class-scope-with-setinterval/196797
**Category:** flash
**Created:** [August 11, 2006, 1:44am UTC](https://forum.kirupa.com/t/losing-class-scope-with-setinterval/196797 "2006-08-11T01:44:52Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Ozymandias](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ozymandias/32/1997_2.png) [@Ozymandias](https://forum.kirupa.com/u/Ozymandias)
#### Post date: [August 11, 2006, 1:44am UTC](https://forum.kirupa.com/t/losing-class-scope-with-setinterval/196797/1 "2006-08-11T01:44:52Z")

</div>

How do I fix this? With this code in my class:

function moveDelay():Void {  
myInterval = setInterval(this.movePoints, delay);  
}

I lose scope when it calls the function. “this” becomes undefined.
