# unloadMovie won't unload movie

**URL:** <https://forum.kirupa.com/t/unloadmovie-wont-unload-movie/189050>\
**Category:** flash\
**Created:** [May 12, 2006, 9:19pm UTC](https://forum.kirupa.com/t/unloadmovie-wont-unload-movie/189050 "2006-05-12T21:19:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SoCalMX](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@SoCalMX](https://forum.kirupa.com/u/SoCalMX)\
**Post date:** [May 12, 2006, 9:19pm UTC](https://forum.kirupa.com/t/unloadmovie-wont-unload-movie/189050/1 "2006-05-12T21:19:44Z")

</div>

Any help is VERY much appreciated:

The following code is used to display a help message and then remove it.

A single button is used to toggle the display of the help message. The code works fine the first time, but unloadMovie fails after that:

- Click “btn\_photoHelp” and you get the help message, click again and it’s gone.
- Click a 3rd time and you get the help message, click again and the message does not unload (and never will again).

Can anyone help with this one? As a note, the problem is not related to the “helpAlreadyClicked variable”, as that has been tested extensively and is working fine. Also, note sure what this means, but “trace(my\_newHelpSWF.getDepth())” always shows a depth of 1048576.

I am using unLoadMovie and not removeMovieClip, as the following is included in the Flash Help documentation:  
If you must use getNextHighestDepth() with version 2 components, you can use swapDepths() to assign a valid depth value or use MovieClip.unloadMovie() to remove the contents of the movie clip.

here’s the code

```
                                                                                                                                                                                                                                                                                                                        Attach Code                                                                                      

```

btn\_photoHelp.onRelease = function() {  
if (helpAlreadyClicked == false) {  
attachMovie(“newHelpSWF”, “my\_newHelpSWF”, getNextHighestDepth(), {\_x:95.4, \_y:389}); //works - help is displayed  
helpAlreadyClicked = true;  
trace(my\_newHelpSWF.getDepth());  
} else if (helpAlreadyClicked == true) {  
unloadMovie(“my\_newHelpSWF”); //works ONLY ONCE. Help is removed once, but never again after the first time  
helpAlreadyClicked = false;  
}  
};
