# Simple AS to unload movie when moving to differnt section of site

**URL:** <https://forum.kirupa.com/t/simple-as-to-unload-movie-when-moving-to-differnt-section-of-site/63940>\
**Category:** flash\
**Created:** [September 11, 2004, 4:13pm UTC](https://forum.kirupa.com/t/simple-as-to-unload-movie-when-moving-to-differnt-section-of-site/63940 "2004-09-11T16:13:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rberry88](https://avatars.discourse-cdn.com/v4/letter/r/df788c/32.png) [@rberry88](https://forum.kirupa.com/u/rberry88)\
**Post date:** [September 11, 2004, 4:13pm UTC](https://forum.kirupa.com/t/simple-as-to-unload-movie-when-moving-to-differnt-section-of-site/63940/1 "2004-09-11T16:13:21Z")

</div>

On my site I have 5 buttons for navagation along the top, when you go to the Photos section there is a button that appears on stage and, when clicked, loads an external swf onto the stage, no problems so far.

If I or the user clicks this button to load this external swf onto the stage and then clicks one of the other navagation buttons to go to a different section of the site, that external swf doesn’t disappear.

Is there a simple AS solution, or do I need to put an unloadMovie line on each of my navagation buttons?

Here’s my site, the Photos page is the one that loads the external swf:  
[http://rberry883.home.comcast.net](http://rberry883.home.comcast.net)

---

<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:** [September 12, 2004, 12:30am UTC](https://forum.kirupa.com/t/simple-as-to-unload-movie-when-moving-to-differnt-section-of-site/63940/2 "2004-09-12T00:30:19Z")

</div>

you can use the removeMovieClip function to remove externally loaded movieclips.

```auto
*target*.removeMovieClip();
//or
removeMovieClip(*target*);

```

hope this helps

---

<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:** [September 12, 2004, 12:55am UTC](https://forum.kirupa.com/t/simple-as-to-unload-movie-when-moving-to-differnt-section-of-site/63940/3 "2004-09-12T00:55:43Z")

</div>

Do I put that code on all my buttons in my navagation bar or do I put it on the frame at the beginning of each section?
