Drag and child index

I have 2 sprites on stage each containing some children…

function startDragCard(e:MouseEvent):void {

//would it be possible to write this line so that it “accepts” drag child from any of two sprites so that I dont have to separate my code?
thumbSprite.setChildIndex(e.target as DisplayObject, thumbSprite.numChildren - 1);
//or
centerSprite.setChildIndex(e.target as DisplayObject, centerSprite.numChildren - 1);


edit:
I think I found the answer myself…

e.target.parent.setChildIndex(e.target as DisplayObject, e.target.parent.numChildren - 1);