Either put the dots in a container with the object,
or give the dots an instance variable and compare..
on start of layout
-- for each dot
-- object pick nearest to dot.x,dot.y
object set variable to dot.uid
object.variable = dot.uid
object follow dot