Your code works. The reason your line is spawning in the middle is because, the origin point is in the center of your Sprite so when you set your objects width it will expand in both directions, You could always fix this by positioning your object between the positions or just change the origin to something like this
Here's the example all I did was change the origin
https://www.dropbox.com/s/9hjznsrsg4e0a ... .capx?dl=0
Good luck with your project if you have any questions just ask or PM me <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">