# unloadClip delay problem

**URL:** <https://forum.kirupa.com/t/unloadclip-delay-problem/228342>\
**Category:** flash\
**Created:** [June 7, 2007, 12:52am UTC](https://forum.kirupa.com/t/unloadclip-delay-problem/228342 "2007-06-07T00:52:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RazorZero](https://avatars.discourse-cdn.com/v4/letter/r/58956e/32.png) [@RazorZero](https://forum.kirupa.com/u/RazorZero)\
**Post date:** [June 7, 2007, 12:52am UTC](https://forum.kirupa.com/t/unloadclip-delay-problem/228342/1 "2007-06-07T00:52:22Z")

</div>

I"m having a tiny problem with unloading an external swf using the MovieClipLoader object. This is what I"m doing:

```auto
if (mcLoader.unloadClip(container)) {
 trace(container.testVar) // shows testVar
}
 
button.clickHandler = function () {
 trace(container.testVar) // says undefined when clicked
}

```

So what’s happening is right after I call unloadClip it’s still loaded however if I click the button at some point after unloadClip is called it shows that is has been unloaded. So obviously there’s a little bit of a delay while things are being unloaded. My question is, does anyone know of a way to detect when the clip is unloaded like with an event listener or something? I want to be able to load up another swf after one is unloaded for the level maps for my game I’m working on. Thanks in advance!
