# createEmptyMovieClip and swapDepth... co-existence is futile!

**URL:** <https://forum.kirupa.com/t/createemptymovieclip-and-swapdepth-co-existence-is-futile/271771>\
**Category:** Uncategorized\
**Created:** [September 28, 2008, 6:44am UTC](https://forum.kirupa.com/t/createemptymovieclip-and-swapdepth-co-existence-is-futile/271771 "2008-09-28T06:44:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![YoungNastyMan](https://avatars.discourse-cdn.com/v4/letter/y/a6a055/32.png) [@YoungNastyMan](https://forum.kirupa.com/u/YoungNastyMan)\
**Post date:** [September 28, 2008, 6:44am UTC](https://forum.kirupa.com/t/createemptymovieclip-and-swapdepth-co-existence-is-futile/271771/1 "2008-09-28T06:44:08Z")

</div>

Hello,  
I need help with a little project (a website I’m building). My main page has links that when clicked will open various external swfs that can be dragged around the stage. swapDepth is used so that the selected swf will always appear on top of the others when the user selects it. It works beautifully except when I load one external swf that happens to be an mp3 player. My problem: once the mp3 player is loaded, it always appears on top no matter which movie clip is selected. By process of elimination, I’ve discovered that this is due to the createEmptyMovieClip function I use in the mp3 player.

Here’s the code that gives the swapDepth a difficult time:

```auto

function preloader () {	
	this.createEmptyMovieClip("KillFocusManager", 1048574);
	var temp = this.createEmptyMovieClip("temp", 9999);
    	temp.onEnterFrame = function() {
        	var snd_loaded = my_sound.getBytesLoaded();
        	var snd_total = my_sound.getBytesTotal();
        	var getPercent = Math.round((snd_loaded/snd_total)*100);
        	loadBar._xscale = getPercent;
			////////////////////////////
			var pos = my_sound.position;
			var dur = my_sound.duration;
			var wid = loadBar._width;
			if (this._parent.sndState != "stopped") {
			mcPositionBar._width = ((pos / dur) * 100) * (wid / 100);
			};
			////////////////////////////
			my_sound.onSoundComplete = nextSong

		}
}

```

Does anyone here know a good workaround? Anything to help?
