# Need Image to Appear after Delay

**URL:** <https://forum.kirupa.com/t/need-image-to-appear-after-delay/186095>\
**Category:** Uncategorized\
**Created:** [April 19, 2006, 12:11am UTC](https://forum.kirupa.com/t/need-image-to-appear-after-delay/186095 "2006-04-19T00:11:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![funfunfun](https://avatars.discourse-cdn.com/v4/letter/f/9fc348/32.png) [@funfunfun](https://forum.kirupa.com/u/funfunfun)\
**Post date:** [April 19, 2006, 12:11am UTC](https://forum.kirupa.com/t/need-image-to-appear-after-delay/186095/1 "2006-04-19T00:11:55Z")

</div>

How can I make an image appear (a button) after a delay of say 15 seconds?

I need the image to display after 15 seconds, and then stay. I have read to use gettimer or setInterval, but I’m not sure how to do it in my particular case. In very rough terms, I need something like this:

onEnterFrame:  
setInterval to 15000 and then  
\_root.button.gotoAndPlay(2); (this will display my image)  
clearInterval

---

<div class="post-metadata">

**Author:** ![B\_L\_U\_E](https://avatars.discourse-cdn.com/v4/letter/b/ba8739/32.png) [@B\_L\_U\_E](https://forum.kirupa.com/u/B_L_U_E)\
**Post date:** [April 19, 2006, 12:27am UTC](https://forum.kirupa.com/t/need-image-to-appear-after-delay/186095/2 "2006-04-19T00:27:25Z")

</div>

[AS]onClipEvent(load) {  
func = function() {  
this.gotoAndPlay(2); //or \_root.button.gotoAndPlay(2);  
clearInterval(si);  
}  
si = setInterval(func,15000);  
}[/AS]put it on the movieclip :cowboy:

---

<div class="post-metadata">

**Author:** ![funfunfun](https://avatars.discourse-cdn.com/v4/letter/f/9fc348/32.png) [@funfunfun](https://forum.kirupa.com/u/funfunfun)\
**Post date:** [April 19, 2006, 12:44am UTC](https://forum.kirupa.com/t/need-image-to-appear-after-delay/186095/3 "2006-04-19T00:44:37Z")

</div>

That looks good. Thank you very much. If you have a spare moment . . .  
could you let me know how it works?

The code looks like it wraps inside of itself, so it is confusing. I saw something similar in a book, but I just couldn’t wrangle it.

The confusion is because the variable ‘si’ is the setInterval, but the setInterval uses the ‘func’ function which contains the clearInterval which acts on si. I think I get the last part, because obviously the clearInterval will take out the setInterval.

---

<div class="post-metadata">

**Author:** ![funfunfun](https://avatars.discourse-cdn.com/v4/letter/f/9fc348/32.png) [@funfunfun](https://forum.kirupa.com/u/funfunfun)\
**Post date:** [April 21, 2006, 5:31pm UTC](https://forum.kirupa.com/t/need-image-to-appear-after-delay/186095/4 "2006-04-21T17:31:44Z")

</div>

Could any one break down this snippet-o-setInterval code line by line?

I would be truly greatful.
