Im trying to implement some depth swapping in my engine, what I want is characters to change depths depending their Y coordinate, is 2d so it has that 3d depth feeling (like those old beat em ups konami used to make, the simpsons, tmnt remember?) in order to do that I need to swap character depths on the fly.

So far what Im doing is creating different child instances of a movieClip in the stage (back, medium, close) and I addchild the movieClip to its depth.

pseudocode
Code:
back=new Sprite();
addChild(back)
back.addChild(backgroundSprite)
medium.addChild(characterSprite)
etc...
But I dont know how to change the characters depth.