This is really easy if you understand the last function, cos basically is the same thing. We are just changin the mouse cursor with anoter movie position.
function follow(mc, myTarget, lowerDistance) {
 orig = {x:mc._x, y:mc._y};
 dest = {x:myTarget._x, y:myTarget._y};
 myAngle = Math.atan2((orig.y-dest.y), (orig.x-dest.x));
 myDistance = Math2.distanceBetween(orig.x, orig.y, dest.x, dest.y)-lowerDistance;
 if (myDistance+lowerDistance>=lowerDistance) {
  mc._x -= Math2.cos(myAngle)*(myDistance/reductionMultiplier);
  mc._y -= Math2.sin(myAngle)*(myDistance/reductionMultiplier);
 }
}


Now we have another argument (the target movie) instead of using the mouse position. That's all!

Next section will cover how to keep a distance between balls