Problem with removing keyboard event from stage

I’m trying to write a function that, when the mouse rolls over a MovieClip object, if the user presses the up/down button, then the movie clip will climb/descend in the containers child list. In other words, if the mouse is on the object, and I press up, the target object should come forward in depth.

So far this is what I have:


myMovie.addEventListener(MouseEvent.ROLL_OVER, changeDepth);
myMovie.addEventListener(MouseEvent.ROLL_OUT, changeDepth);
                      
function changeDepth(e:MouseEvent) {[INDENT]var target = e.target;
trace(e.type);
var targDepth = container.getChildIndex(target);
var maxDepth = container.numChildren;
if (e.type == "rollOver") {[INDENT]stage.addEventListener(KeyboardEvent.KEY_UP, depthSwap);
[/INDENT]} else if(e.type == "rollOut"){[INDENT]stage.removeEventListener(KeyboardEvent.KEY_UP, depthSwap);
[/INDENT]}

function depthSwap(e:KeyboardEvent) {[INDENT]if (e.keyCode == 38) {[INDENT]if (targDepth+1<maxDepth) {[INDENT][INDENT]container.setChildIndex(target,targDepth+1);
[/INDENT][/INDENT]} else if (e.keyCode == 40) {[INDENT] if (targDepth>1) {[INDENT]container.setChildIndex(target,targDepth-1);
[/INDENT]}
[/INDENT]}
[/INDENT]}
[/INDENT]}
[/INDENT]}

My issue is that the KeyboardEvent still fires off when I roll out of my target MovieClip… (May of had some braces get unbalanced while copy pasting)
:h: