# How to delete "under" movies created with "getNextHighestDepth();"

**URL:** <https://forum.kirupa.com/t/how-to-delete-under-movies-created-with-getnexthighestdepth/248220>\
**Category:** flash\
**Created:** [January 5, 2008, 7:13am UTC](https://forum.kirupa.com/t/how-to-delete-under-movies-created-with-getnexthighestdepth/248220 "2008-01-05T07:13:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![suicidebilly](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@suicidebilly](https://forum.kirupa.com/u/suicidebilly)\
**Post date:** [January 5, 2008, 7:13am UTC](https://forum.kirupa.com/t/how-to-delete-under-movies-created-with-getnexthighestdepth/248220/1 "2008-01-05T07:13:45Z")

</div>

Hello to all, i have a question about Depths that i can´t solve it.

I´ve created a movie that load some images one over another, if i click a button a image is loaded, if a click another button another image is loaded over the previous one and so on…

What i want to do is to “Unload or Remove” the image under the new one after this new one is 100% loaded.

I load the images with this code.::

```auto

//Button 1

this.onRelease = function(){

    _root.main.createEmptyMovieClip("container");
    _root.main.attachMovie("img1", "container", _root.main.getNextHighestDepth());

}

// Button 2

this.onRelease = function(){

    _root.main.createEmptyMovieClip("container");
    _root.main.attachMovie("img2", "container", _root.main.getNextHighestDepth());

}

//Button 3

this.onRelease = function(){

    _root.main.createEmptyMovieClip("container");
    _root.main.attachMovie("img3", "container", _root.main.getNextHighestDepth());

}

```

My question is How can i remove the MovieClip under the New loaded movie ?

I´ve tryied to use “unloadMovie” and “removeMovieClip” but i don´t know how to especify the Depth Bellow of the loaded movie or if it´s possible to delete this movie because is the same Mc “container” that loads the new image.

Can anyone help me with this ? :puzzle:
