# Attach movie clips then play with delay

**URL:** <https://forum.kirupa.com/t/attach-movie-clips-then-play-with-delay/184158>\
**Category:** Uncategorized\
**Created:** [April 2, 2006, 8:47pm UTC](https://forum.kirupa.com/t/attach-movie-clips-then-play-with-delay/184158 "2006-04-02T20:47:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![natronp](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@natronp](https://forum.kirupa.com/u/natronp)\
**Post date:** [April 2, 2006, 8:47pm UTC](https://forum.kirupa.com/t/attach-movie-clips-then-play-with-delay/184158/1 "2006-04-02T20:47:26Z")

</div>

I’m looking for a simple method to control the fade in animation of dynamically attached clips. In other words a menu where the attached items (xml driven) attach and then the first menu button fades in and then the second, third, etc. (the animation/fade would simply be frames in each clip)

I imagine there’s a simple way to do this but I haven’t been able to figure out how.

thanks for any input!

---

<div class="post-metadata">

**Author:** ![therafiman](https://avatars.discourse-cdn.com/v4/letter/t/2acd7d/32.png) [@therafiman](https://forum.kirupa.com/u/therafiman)\
**Post date:** [April 2, 2006, 11:10pm UTC](https://forum.kirupa.com/t/attach-movie-clips-then-play-with-delay/184158/2 "2006-04-02T23:10:25Z")

</div>

You’d have a counter for which clip is currently fading in, and use setInterval to call each one with a delay. eg lets say u hav 10 clips called item1, item2, item3 etc. and you want a delay of 100ms. You could do:

counter = 1;  
numItems = 10;  
myInterval = setInterval(fadeInClip, 100);

function fadeInClip()  
{  
[INDENT]// Fade in next clip  
\_root[“item” + counter].play();

// If all clips done, stop calling this function,  
// otherwise increment the counter  
if(counter == numItems) clearInterval(myInterval);  
else counter++;  
[/INDENT] }

---

<div class="post-metadata">

**Author:** ![natronp](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@natronp](https://forum.kirupa.com/u/natronp)\
**Post date:** [April 3, 2006, 1:21am UTC](https://forum.kirupa.com/t/attach-movie-clips-then-play-with-delay/184158/3 "2006-04-03T01:21:27Z")

</div>

okay, that makes sense… i’ll give that a try. thank you.
