you could try the event: "Is overlapping another object".
the laser would go from your player to infinity, but it will recognise if something is in the way. if i understand your problem correctly this is allready the solution to your problem. you don't need to calculate the distance.
if you need the distance, you need the x and y coordinates of the object your laser is crossing and calculate the difference to the player.
!! i hope that i don't write nonsense
let's say the player is at:
x = 100
y = 100
and the enemy or obstacle ist at:
x = 215
y = 312
now you have to do some math:
at first you calculate the difference between the x and y coordinates
215 - 100 = 115
312 - 110 = 212
now you need our good friend pythagoras
calculate the square root of (115^2 + 212^2)
the solution to this is 241,18
\|(115^2 + 212^2)
so much for my ascii art Pete2011-09-17 07:14:33