# Problems getting swf's to load using getNextHighestDepth

**URL:** https://forum.kirupa.com/t/problems-getting-swfs-to-load-using-getnexthighestdepth/268561
**Category:** flash
**Created:** [August 15, 2008, 7:02am UTC](https://forum.kirupa.com/t/problems-getting-swfs-to-load-using-getnexthighestdepth/268561 "2008-08-15T07:02:53Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ambivert](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@ambivert](https://forum.kirupa.com/u/ambivert)
#### Post date: [August 15, 2008, 7:02am UTC](https://forum.kirupa.com/t/problems-getting-swfs-to-load-using-getnexthighestdepth/268561/1 "2008-08-15T07:02:53Z")

</div>

I have a flash movie with some buttons that load swf’s into the movie. Here is the code I have attached to the buttons:

on(press){  
var container:MovieClip = this.createEmptyMovieClip(“weddingClip”, this.getNextHighestDepth());  
weddingClip.loadMovie(“wedding.swf”);  
}

This actually works fine the first time. The problem is that if I press button 1 and it loads the appropriate swf, then I press button 2 and it loads it’s appropriate swf, if I decide to go back to 1, it won’t come up because it is already loaded below #2. I would think it would come up in depth.

Here is the link to the site for demonstration purposes:

[http://rocket88studios.com/lapremier/Main2.html](http://rocket88studios.com/lapremier/Main2.html)

Any ideas?
