# Unloading a swf

**URL:** https://forum.kirupa.com/t/unloading-a-swf/11014
**Category:** Uncategorized
**Created:** [January 10, 2003, 5:50pm UTC](https://forum.kirupa.com/t/unloading-a-swf/11014 "2003-01-10T17:50:21Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![gizchip](https://avatars.discourse-cdn.com/v4/letter/g/b3f665/32.png) [@gizchip](https://forum.kirupa.com/u/gizchip)
#### Post date: [January 10, 2003, 5:50pm UTC](https://forum.kirupa.com/t/unloading-a-swf/11014/1 "2003-01-10T17:50:21Z")

</div>

hello all. this is probably a piece of cake, but i cant seem to get it right. i want to be able to close a swf from within another swf. iwant to be able to do this:

[www.murderdolls.com](http://www.murderdolls.com)

go to media… click on a photo thumbnail… the larger image contains a “close window” button.

how do i “close window”?

thanks in advance!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 10, 2003, 5:52pm UTC](https://forum.kirupa.com/t/unloading-a-swf/11014/2 "2003-01-10T17:52:04Z")

</div>

do you mean unloadMovieNum(levelNum); ?  
(or even myMovieClip.removeMovieClip(); depending on where your ‘swf’ is)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 10, 2003, 5:54pm UTC](https://forum.kirupa.com/t/unloading-a-swf/11014/3 "2003-01-10T17:54:30Z")

</div>

yes. i crrently have

on (release) {  
unloadMovie (1);  
}

that aint doing the trick. any suggestions?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 10, 2003, 6:04pm UTC](https://forum.kirupa.com/t/unloading-a-swf/11014/4 "2003-01-10T18:04:48Z")

</div>

but thats not what I put

unloadMovie **Num** (levelNum);

😉

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 10, 2003, 6:11pm UTC](https://forum.kirupa.com/t/unloading-a-swf/11014/5 "2003-01-10T18:11:21Z")

</div>

my pictures are currently loading into an empty MC with the follwing actions.

on (release) {  
loadMovie (“pic1.swf”, “pic”);  
}

so now…how would i close pic1.swf’s window in my main movie?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 10, 2003, 6:21pm UTC](https://forum.kirupa.com/t/unloading-a-swf/11014/6 "2003-01-10T18:21:23Z")

</div>

then use removemovieclip

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 10, 2003, 6:29pm UTC](https://forum.kirupa.com/t/unloading-a-swf/11014/7 "2003-01-10T18:29:49Z")

</div>

i’m sorry. i’m really new to this… removemovieclip?

what would the action assigned to my “close window” button look like?

thanks man.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 10, 2003, 6:33pm UTC](https://forum.kirupa.com/t/unloading-a-swf/11014/8 "2003-01-10T18:33:38Z")

</div>

heres a windowed remove movieclip example  
[http://www.kirupaforum.com/attachment.php?s=&postid=80161](http://www.kirupaforum.com/attachment.php?s=&postid=80161)

this doesnt load swfs, but the action would be the same (well depending)…

removeMovieclips removes the actuall containing movieclip where you might have loaded your external swf. If you want to re-use that movieclip for other swfs, you wouldnt want to remove that movieclip all together, but rather unload the movie thats in it. That would use

unloadMovie(moviecliptarget)

The example in the link above dynamically re-creates the movieclips which are the windows so removeMovieclip works fine.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 10, 2003, 6:51pm UTC](https://forum.kirupa.com/t/unloading-a-swf/11014/9 "2003-01-10T18:51:39Z")

</div>

thanks man. much appreciated.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 10, 2003, 7:25pm UTC](https://forum.kirupa.com/t/unloading-a-swf/11014/10 "2003-01-10T19:25:24Z")

</div>

dude… this is driving me nuts. i revised my code a little. now the photo thumbnail buttons look like this:

on (release) {  
\_root.pic.loadMovie(“pic1.swf”);  
}

“pic1.swf” loads into an empty MC called “pic”.

so the user clicks on the first thumbnail, and “pic1.swf” loads onto the page. i still cant get the loaded pic1.swf to close. i dont get it. i’m not sure what the set the target to. i’m not sure what the correct code looks like. please help. i’m banging my head against the wall.

thanks!
