3-way collision makes black line appear

Hello - I have a situation…
I’m making an info-animation piece, and it involves 3 random moving circles that when all 3 touch eachother, a black line will connect all 3 at their centerpoint, and this black line will disappear when they move away from eachother. Has anyone the code or suggestions for an actionscript like this?
Any help is greatly, greatly appreciated.
Cheers,
future-pilot