I've got a line with several (five for now) points on it and I need to have the user slide the points back & forth along the line...no problem yet...

Now, I've got to have an indicator that stays on the middle point. No problem if I just drag the middle point back and forth between the others, however, if I drag the middle point past one of the points next to it, I need the indicator to stay with the NEW middle point while still dragging the original point.

What would be a good way to determine which point is the "middle?" I was thinking of starting an onEnterFrame to call a function when they startDrag to create an associative array with point number & x value, sort by x value and return the middle value...but it seems like there should be an easier way...

Any ideas??