# setInterval Problem

**URL:** <https://forum.kirupa.com/t/setinterval-problem/236205>\
**Category:** Uncategorized\
**Created:** [August 18, 2007, 9:59am UTC](https://forum.kirupa.com/t/setinterval-problem/236205 "2007-08-18T09:59:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![darkstyle](https://avatars.discourse-cdn.com/v4/letter/d/a5b964/32.png) [@darkstyle](https://forum.kirupa.com/u/darkstyle)\
**Post date:** [August 18, 2007, 9:59am UTC](https://forum.kirupa.com/t/setinterval-problem/236205/1 "2007-08-18T09:59:03Z")

</div>

Hi friends,  
This code works fine when i publish the swf in the macromedia flash 8, but when insert the following swf in the html page it doesnt work! please could u guys can tell me where am i going wrong??

I have attached the source file also.

CODE:

```php
stop();

//define the function for the interval to call
function playSlideshow() {
    play();

}

//start your slideshow when the swf loads 
_root.onLoad = function(){

 myInt = setInterval(playSlideshow, 5000);
}

if(done == true){
    clearInterval(myInt);
    myInt = setInterval(playSlideshow(), 5000);
}

```
