# Help needed! Class question

**URL:** <https://forum.kirupa.com/t/help-needed-class-question/193432>\
**Category:** flash\
**Created:** [July 13, 2006, 9:23am UTC](https://forum.kirupa.com/t/help-needed-class-question/193432 "2006-07-13T09:23:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![manorius](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@manorius](https://forum.kirupa.com/u/manorius)\
**Post date:** [July 13, 2006, 9:23am UTC](https://forum.kirupa.com/t/help-needed-class-question/193432/1 "2006-07-13T09:23:41Z")

</div>

Hi Guys,

Can someone help me please with this issue?  
I would like to focus my question on the setInterval and clearInterval use inside a class.  
isn’t bellow the right way to use it ?

Class:

```auto

class doIt extends MovieClip{

private var nTimes:Number;

private function startInt(){
this.nTimes=setInterval(this,"doSmthing",1000);
}

function stopInt(){
clearInterval(this.nTimes);
}

private function doSmthing(){

trace("doSmthing");
}

}

```

On the timeline in order to start the function doSmthing() executing every 1 sec I type:

this.nameOfmc.startInt();

and in order to clear the interval and stop the function from executing I write

this.nameOfmc.stopInt();

I’m so confused because I tried everything and it’s still not working…  
I’m sure I’m doing something wrong but don’t know what is it…

Thanks a lot!  
Manolis
