I made some small changes, like changing the origin of the line to left, and using two objects instead of an instance variable (easier in this case, in my opinion).
My suggestion: LineBetweenDots.capx
If you do not mind, can you help me with something else?
I need to make this line not to get over some area like on the screen:
<img src="http://s1.ipicture.ru/uploads/20120425/dWp771QE.png" border="0">