Another option is to use distance(ObjectA.X,ObjectA.Y,ObjectB.X,ObjectB.Y) when using set width for your "beam" object.
I am using tiled background instead of a sprite for tractor beam, but I think it should work with sprites as well if you setup your origin point correctly.
Edit: Now with .capx for proper tractor-beam action.
dropbox.com/s/t54zvcbp2faqvnw/Tractorbeam.capx
I actually might create a small game based on this mechanic.