Help needed! Class question

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:


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