[swapDepths] Beyond frustrated. What is wrong?

Hey everyone, first post, really hoping someone can point out what the hell is going on here. Basically, I am creating this build-your-own snowman game. The problem is the layering of items that stick to the snowman. Aka, hats, eyes, noses, etc. These items are being loaded into an empty movie clip as a graphic and for the life of me I cannot figure out how the depth of these items are being sorted and nothing I do is letting me change the depth of any items. I.E. eyes are ALWAYS above hats, but why? I have no idea. I never told it to do that, and layers of empty MC’s have no effect what so ever.

Anyway, heres some chunks of code to take a look at.

This is the basic code for each item.

tophat_mc.onPress = function():Void {
	this.startDrag(true);
	
	xstart = this._x;
	ystart = this._y;
	tophat_mc.gotoAndPlay(1);
	tophatmcrollover.gotoAndStop(1);
	unloadMovie (_root.empty.hats);
	swapDepths(_root.menu_mc.A);
	swapDepths(_root.menu_mc.B);
	swapDepths(_root.menu_mc.C);
	swapDepths(_root.menu_mc.D);
	swapDepths(_root.menu_mc.E);
	swapDepths(_root.menu_mc.F);
	swapDepths(_root.menu_mc.G);
	swapDepths(_root.menu_mc.H);
	
	//swapDepths(_root.empty2.eyes);
	
	
};

tophat_mc.onRollOver = function() {
		tophatmcrollover.gotoAndStop(2);
	};
tophat_mc.onRollOut = function() {
		tophatmcrollover.gotoAndStop(1);
		};

tophat_mc.onRelease = function():Void {
	this.stopDrag();
	if (eval(this._droptarget) == _root.hatsTarget_mc) {
        
		tophat_mc.gotoAndStop(11);

		this.enabled = false;
	
		_root.empty._x=317.9;
		_root.empty._y=67.4;
		// var innerJpegTarget= 
		_root.empty.hats_mc("jpgHolder",empty);

		var mcl:MovieClipLoader = new MovieClipLoader();

		var mclListener:Object=new Object();
		mclListener.onLoadInit=function(targ){
			
		//center it
   		targ._x=-targ._width/2;
    	targ._y=-targ._height/2;
}

		mcl.addListener(mclListener);

		mcl.loadClip("tophat.png",_root.empty.hats);

                //swapDepths(_root.empty2.eyes);
		
		
	}
	else{
        
		this._x = xstart;
		this._y = ystart;
		tophat_mc.gotoAndStop(1);
		_root.menu_mc.A.swapDepths(1);
		_root.menu_mc.B.swapDepths(1);
		_root.menu_mc.C.swapDepths(1);
		_root.menu_mc.D.swapDepths(1);
		_root.menu_mc.E.swapDepths(1);
		_root.menu_mc.F.swapDepths(1);
		_root.menu_mc.G.swapDepths(1);
		_root.menu_mc.H.swapDepths(1);
	  
	}
};

More specifically… //swapDepths(_root.empty2.eyes);

This is the basic idea of swapping the hat above the eyes, but alas does not do anything. I have tried many other pieces of code, I just seem to have no control of the loaded MC with graphics once they are in place.

The FLA and PNGs can be downloaded here if anyone would like to take an in depth look. It would be greatly appreciated. This really needs to be sorted out.

Thanks

  • Alex