You can do it with the distance command.
The way you use it is by adding a comparison from the system and in the first value you just write:
Distance(x1,y1,x2,y2) that will give you the distance between two objects.
In your case it would probably look something like this:
Distance(Flashlight.X, Flashlight.Y, Enemy.X, Enemy.Y) < 50
You can use the Distance function in any comparison event, so just use the one that fits, what you try to do.