You can make a square sprite (your line) and change its origin point to the left.
on touch start,
pick nearest word to touch.x touch.y
create object sprite at word.x, word.y
set position to word.x word.y
save that x and y value as touchstartX touchstartY
while in drag - > set the width to distance(touchstartx, touchstartY, touch.x, touch.y)
set sprite . angle = (touchstartx, touchstarty, touch.x, touch.y)
this will make the box stretch and aim at whatever you are dragging to
on touch end ,
pick nearest object(eg: shoe)
set sprite width to (word.x word.y, shoe.x, shoe.y)
set angle to (word.x word.y, shoe.x, shoe.y)
when you let go it will leave the line connecting the two items