# Unload movie clip

**URL:** <https://forum.kirupa.com/t/unload-movie-clip/166629>\
**Category:** Uncategorized\
**Created:** [October 21, 2005, 12:55pm UTC](https://forum.kirupa.com/t/unload-movie-clip/166629 "2005-10-21T12:55:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jta](https://avatars.discourse-cdn.com/v4/letter/j/ee7513/32.png) [@jta](https://forum.kirupa.com/u/jta)\
**Post date:** [October 21, 2005, 12:55pm UTC](https://forum.kirupa.com/t/unload-movie-clip/166629/1 "2005-10-21T12:55:31Z")

</div>

Hi all,  
I used the tutorial in this site for the “load random movieclip”  
The code looks like this:

* * *

filename = [“Image00.swf”, “Image00.swf”, “Image00.swf”, “Image00.swf”];  
path = “swf\_files/”;  
i = filename.length;  
k = Math.floor(Math.random()\*i);  
loadMovie(path+filename[k], movieTarget);

* * *

It works prefectly fine, but now my question is, I want to be able to unload the randomly loaded swf. I try to make a button and assigned the unloadMovie script to it  
and I’ve this:

on(release){  
unloadMovie(movieTarget);  
}

but it doesn’t work, does anyone have any ideas?

I tried to put “movieTarget” or even ‘movieTarget’ but still doesn’t work. I would need help for this.

Thanks in advance 🙂
