# Using setInterval within a class? Not working

**URL:** <https://forum.kirupa.com/t/using-setinterval-within-a-class-not-working/184953>\
**Category:** flash\
**Created:** [April 9, 2006, 6:44pm UTC](https://forum.kirupa.com/t/using-setinterval-within-a-class-not-working/184953 "2006-04-09T18:44:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![devinstar](https://avatars.discourse-cdn.com/v4/letter/d/e495f1/32.png) [@devinstar](https://forum.kirupa.com/u/devinstar)\
**Post date:** [April 9, 2006, 6:44pm UTC](https://forum.kirupa.com/t/using-setinterval-within-a-class-not-working/184953/1 "2006-04-09T18:44:07Z")

</div>

function onLoad(){  
trace(“Calling SetInterval”);  
setInterval(this,“resizeImage”,1000);  
}

function resizeImage() {

}

Why is this setInterval not working? I am using this code within a class.

Thanks :thumb:

---

<div class="post-metadata">

**Author:** ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)\
**Post date:** [April 9, 2006, 7:05pm UTC](https://forum.kirupa.com/t/using-setinterval-within-a-class-not-working/184953/2 "2006-04-09T19:05:50Z")

</div>

From where I’m standing there is nothing in the resizeImage function but I’m assuming that you didn’t post the entire code, so could you?

🙂

---

<div class="post-metadata">

**Author:** ![devinstar](https://avatars.discourse-cdn.com/v4/letter/d/e495f1/32.png) [@devinstar](https://forum.kirupa.com/u/devinstar)\
**Post date:** [April 9, 2006, 7:12pm UTC](https://forum.kirupa.com/t/using-setinterval-within-a-class-not-working/184953/3 "2006-04-09T19:12:23Z")

</div>

I think what the problem is that the movie clip that I have assigned that class to. I am loading in a jpeg to that movie clip. Which now according to my reading Flash Help wipes all the code associated with my movie clip? So nothing in my class will work.

What I want to do it.

Load a jpeg into a movie clip, when the jpeg is loaded resize that movie clip.

I want to do this will attach numerous movieclips to the stage at the same time

---

<div class="post-metadata">

**Author:** ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)\
**Post date:** [April 9, 2006, 7:50pm UTC](https://forum.kirupa.com/t/using-setinterval-within-a-class-not-working/184953/4 "2006-04-09T19:50:40Z")

</div>

If I were you I’d load the image into an empty movie clip within the movie clip with the class association.

---

<div class="post-metadata">

**Author:** ![devinstar](https://avatars.discourse-cdn.com/v4/letter/d/e495f1/32.png) [@devinstar](https://forum.kirupa.com/u/devinstar)\
**Post date:** [April 9, 2006, 7:53pm UTC](https://forum.kirupa.com/t/using-setinterval-within-a-class-not-working/184953/5 "2006-04-09T19:53:58Z")

</div>

can you check then if its loaded? and do a preloader and all that?

---

<div class="post-metadata">

**Author:** ![devinstar](https://avatars.discourse-cdn.com/v4/letter/d/e495f1/32.png) [@devinstar](https://forum.kirupa.com/u/devinstar)\
**Post date:** [April 9, 2006, 8:13pm UTC](https://forum.kirupa.com/t/using-setinterval-within-a-class-not-working/184953/6 "2006-04-09T20:13:10Z")

</div>

got it to work :tb: yay thanks for that
