Battle Auto Detect

I am making a strategy game. Is there any way to detect the closest sprite to any given sprite in order to automatically move toward the closest sprite and thus "attack" it upon contact?

You would need to monitor the x/y coordinates (and perhaps modify these to get the centres) of the imageSprites concerned, then take an action when two sets of coordinates meet a condition. Not straightforward, but doable ....