# Unload a movie clip as the play head jumps to another frame

**URL:** https://forum.kirupa.com/t/unload-a-movie-clip-as-the-play-head-jumps-to-another-frame/230653
**Category:** flash
**Created:** [June 27, 2007, 10:51pm UTC](https://forum.kirupa.com/t/unload-a-movie-clip-as-the-play-head-jumps-to-another-frame/230653 "2007-06-27T22:51:47Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![smigdig](https://avatars.discourse-cdn.com/v4/letter/s/7cd45c/32.png) [@smigdig](https://forum.kirupa.com/u/smigdig)
#### Post date: [June 27, 2007, 10:51pm UTC](https://forum.kirupa.com/t/unload-a-movie-clip-as-the-play-head-jumps-to-another-frame/230653/1 "2007-06-27T22:51:47Z")

</div>

Hey everyone:

The movie clip is called “theScene” and I have it created on Frame 60 of a movie clip when a button triggers the playhead to jump and stop at Frame 60. However, upon leaving that frame, it will not disappear, so I want to unload it upon leaving that frame.

I put in the following code across all frames of the movie clip in its own layer:

```auto
 
if (this._currentframe !=60)
    {
        theScene.unloadMovie();
    }

```

This does infact unload the movie if I put it in the keyframe with the code that creates it (on Frame 60), but it will not unload it upon moving the play head to another Frame, i.e. clicking a button to jump that movie clip to Frame 50, 70, 100… whatever.

I added a trace(this.\_currentframe), however, it will only trace Frame 1, and never runs again, how do I get it to run everytime the playhead moves?

Thanks,  
Adam
