# setInterval - Delay of LoadMovie

**URL:** <https://forum.kirupa.com/t/setinterval-delay-of-loadmovie/23239>\
**Category:** flash\
**Created:** [June 15, 2003, 3:39am UTC](https://forum.kirupa.com/t/setinterval-delay-of-loadmovie/23239 "2003-06-15T03:39:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AmyDor](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@AmyDor](https://forum.kirupa.com/u/AmyDor)\
**Post date:** [June 15, 2003, 3:39am UTC](https://forum.kirupa.com/t/setinterval-delay-of-loadmovie/23239/1 "2003-06-15T03:39:27Z")

</div>

:hair: I am trying to load a movie after a button is pressed. I can load the movie. I have since realized I need a delay… I want to delay the playing of the movie, after the botton to load the is pressed.

HELP, plz :hair:

---

<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:** [June 15, 2003, 3:57am UTC](https://forum.kirupa.com/t/setinterval-delay-of-loadmovie/23239/2 "2003-06-15T03:57:48Z")

</div>

In the first frame of the movie you are loading…

[AS]function doneDelay(){  
this.play();  
clearInterval(delay);  
}  
delay = setInterval(doneDelay, 3000);  
stop();[/AS]

3000 is the time to delay in milliseconds, so 3000 is actually 3 seconds. After 3 seconds is up the doneDelay function is called on which plays the movie using the play() command and then it clears the interval so that in the next 3 seconds (or any after that :P) the function won’t be called.

---

<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:** [June 15, 2003, 4:17am UTC](https://forum.kirupa.com/t/setinterval-delay-of-loadmovie/23239/3 "2003-06-15T04:17:33Z")

</div>

Thanks for your help. FYI… I had to delete THIS. to have the script function correctly forme. It works!!!

Thanks a Mil

---

<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:** [June 15, 2003, 4:20am UTC](https://forum.kirupa.com/t/setinterval-delay-of-loadmovie/23239/4 "2003-06-15T04:20:59Z")

</div>

Oops, sorry, I typed it up on the spot… usually my untested code fails, you would think I would learn after the first 14000 times but NOOOOOO…lol.

Glad it works now though 🙂
