# Clear interval doesnot work properly

**URL:** https://forum.kirupa.com/t/clear-interval-doesnot-work-properly/260287
**Category:** Uncategorized
**Created:** [May 14, 2008, 6:01am UTC](https://forum.kirupa.com/t/clear-interval-doesnot-work-properly/260287 "2008-05-14T06:01:04Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![resolver](https://avatars.discourse-cdn.com/v4/letter/r/8dc957/32.png) [@resolver](https://forum.kirupa.com/u/resolver)
#### Post date: [May 14, 2008, 6:01am UTC](https://forum.kirupa.com/t/clear-interval-doesnot-work-properly/260287/1 "2008-05-14T06:01:04Z")

</div>

hi,  
i have used the setinterval in a module. i clear the inetrval each time i make it using a function in other class. on long time run the clear interval stops functioning. could any one put light on this problem?

---

<div class="post-metadata">

### Author: ![Pier25](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@Pier25](https://forum.kirupa.com/u/Pier25)
#### Post date: [May 14, 2008, 8:53am UTC](https://forum.kirupa.com/t/clear-interval-doesnot-work-properly/260287/2 "2008-05-14T08:53:49Z")

</div>

How did you call the setInterval?  
How do you clear setInterval?

Maybe you have a problem of scope.

You need to use an id to be able to clear the interval

my\_id = setInterval(bla bla bla);

suposing my\_id is on the \_root

clearInterval(\_root.my\_id)

suposing my\_id is on an mc called my\_module

clearInterval(\_root.my\_module.my\_id).

Basically this is the idea.
