# setTimeout or setInterval problems

**URL:** <https://forum.kirupa.com/t/settimeout-or-setinterval-problems/181156>\
**Category:** flash\
**Created:** [March 6, 2006, 11:10pm UTC](https://forum.kirupa.com/t/settimeout-or-setinterval-problems/181156 "2006-03-06T23:10:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![S34N](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/s34n/32/2149_2.png) [@S34N](https://forum.kirupa.com/u/S34N)\
**Post date:** [March 6, 2006, 11:10pm UTC](https://forum.kirupa.com/t/settimeout-or-setinterval-problems/181156/1 "2006-03-06T23:10:34Z")

</div>

Okay so I have my site setup with temp nav with 4 buttons that you click for each section … for the most part it works fine but I’m having some trouble with loading the sections(swf’s) I want to a empty movie clip at the right time and the site not going crazy! … right now I’m using a setInterval to get the timing right …

```auto
function sectionMain() {
    theWidth = 700;
    theHeight = 375;
    frame.title.text = "Main";
    frameSize();
    frame.slideTo(Stage.width/2-theWidth/2, Stage.height/theHeight*10, slidevel, frameTweenType, .005);
    myinterval = setInterval(function () {
        frame.container.loadMovie("mainsection.swf");
        clearInterval(myinterval);
    }, 2500);
}

```

The problem is that if a user clicks to fast it messes up the clearing of the interval … atleast I thinka that’s what’s happening … because my sections load over and over even if I click on a different one.

so I was wondering if I should use setTimeout instead but I don’t think it works for me … is setTimeout a js fucntion or a Flash 8 function? I see all kinds of people using setTimeout but there isn’t any documentation on it in the Flash 8 help. So if you guys can help I’d apreciate it greatly 🙂 Thanks!
