# Delay prob

**URL:** <https://forum.kirupa.com/t/delay-prob/173260>\
**Category:** Uncategorized\
**Created:** [December 22, 2005, 7:22pm UTC](https://forum.kirupa.com/t/delay-prob/173260 "2005-12-22T19:22:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![modulater](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@modulater](https://forum.kirupa.com/u/modulater)\
**Post date:** [December 22, 2005, 7:22pm UTC](https://forum.kirupa.com/t/delay-prob/173260/1 "2005-12-22T19:22:26Z")

</div>

Hi there,

I used following script found on this forum ( see below). Works fine the only prob. is like when Button 1 loads ‘mymc.swf’ after say a delay of 8000 and when I push button 2 when ‘mymc.swf’ is still not loaded the swf file gets visible. but when I push button2 I don’t want that swf file to be visible.

I have a unloadmoviecode on button2 but that doesn’t seem to work. How solve. Big thx

button1.onPress = function () {  
mcInterval = setInterval(mcloader, delay);  
function mcloader() {  
clearInterval(mcInterval);  
loadMovie(“mymc.swf”,“container”);  
}  
}  
delay = 3000;

button2.onPress = function () {  
loadMovie(“mymc2.swf”,“container2”);  
clearInterval(mcInterval);  
unloadMovie(container);  
}
