Calculating distance witin a movieclip that moves

I am trying to modify this code that is attached to and alpha engine. It is the same code from the tutorial: Calculating Distance

onClipEvent (enterFrame) {
xdist = Math.round(_root._xmouse - _parent._x);
ydist = Math.round(_root._ymouse - _parent._y);
distancefromthis = Math.round(Math.sqrt((xdistxdist) + (ydistydist)));
_parent._alpha = (100-distancefromthis)+20;
}

What i need to know is whether or not i can modify this to calculate the distance of the mouse from the clip, even if it is contained in another clip that moves around the stage.

Any suggestions?