# clearInterval

**URL:** https://forum.kirupa.com/t/clearinterval/21729
**Category:** flash
**Created:** [May 25, 2003, 7:04pm UTC](https://forum.kirupa.com/t/clearinterval/21729 "2003-05-25T19:04:51Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![ck3lam](https://avatars.discourse-cdn.com/v4/letter/c/82dd89/32.png) [@ck3lam](https://forum.kirupa.com/u/ck3lam)
#### Post date: [May 25, 2003, 7:04pm UTC](https://forum.kirupa.com/t/clearinterval/21729/1 "2003-05-25T19:04:51Z")

</div>

I have made a couple of images on each frame with a stop command every frame. I ask the flash to go next frame after every 2 secs. So it’ll show image frame by frame every 2 sec with the setInterval command.  
In the setInterval, i call a function to clear the interval and goto next frame.  
I load this swf in another main swf. but when i unload it by pressing a button,it keep on jump to next frame after certain of time.  
Since in the main flash, i have button set to jump to spesific frame by name. it mess up my work!  
How to solve this problem by preventing it from looping?  
Thanx in advance!!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 26, 2003, 1:44am UTC](https://forum.kirupa.com/t/clearinterval/21729/2 "2003-05-26T01:44:51Z")

</div>

anyone? please

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 26, 2003, 1:54am UTC](https://forum.kirupa.com/t/clearinterval/21729/3 "2003-05-26T01:54:07Z")

</div>

cant you just clear it in the button?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 26, 2003, 5:11am UTC](https://forum.kirupa.com/t/clearinterval/21729/4 "2003-05-26T05:11:51Z")

</div>

i tried to put clearInterval exactly like I put in the function(that loaded swf)in the main button. but i cant work. I wonder what went wrong…  
the clearInterval only works when i put in the swf alone.  
but when i loaded it into other swf, it seem it keep continue looping(jump to next frame coz in the function i ask it to go next frame) after certain times after i unload it.  
well, before i unload this file,i put in the clearInterval again( with same Interval ID and so on) once I press the button. but it’s like nothing effect on it.  
Help please!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 26, 2003, 6:02am UTC](https://forum.kirupa.com/t/clearinterval/21729/5 "2003-05-26T06:02:51Z")

</div>

This is my idea of fla.  
I don’t wanna run it frame by frame, but by using time.  
Thanx again!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 26, 2003, 1:54pm UTC](https://forum.kirupa.com/t/clearinterval/21729/6 "2003-05-26T13:54:26Z")

</div>

frame by frame is time
