Trying to create tabs with swapDepths()

Hey All,

I am having a problem and hope someone can help. I’ve created two mc’s. One called “[color=navy]mcSkinned[/color]” and the other called “[color=navy]mcSkeleton[/color]”. Each of these mc’s has an mc inside of it that acts as the tab (so when the tab is clicked, the focus changes for either mcSkinned or mcSkeleton).

The names of the tab mc’s are:
[color=navy]mcSkeletonTabBackground[/color]
[color=navy]mcSkinnedTabBackground[/color]

So this means that mcSkeleton has mcSkeletonTabBackground in it and mcSkinned has mcSkinnedTabBackground in it.

I’ve placed each main mc (mcSkinned and mcSkeleton) on the main scene and added the following code to an “Actions” layer on the timeline:

[color=red] mcSkeleton.mcSkeletonTabBackground.onPress = function():Void {
mcSkeleton.swapDepths(this.mcSkinned);
};
mcSkinned.mcSkinnedTabBackground.onPress = function():Void {
mcSkinned.swapDepths(this.mcSkeleton);
};[/color]
[color=#ff0000][/color]
[color=black]Now, I know that I’ve done something wrong. Because if it worked, I would not be on here begging for help. Can anyone please let me know how I am screwing this up?[/color]

GOAL: To have two tabs change depths when clicked on their tabs. I do not want these mc’s to be draggable on to change z-depths.

Thanks in advance!