I made this for a platform shooter prototype. I treated a shot as a line, and check if the enemies (which are circular in form) are on the line.

Code:
function Intersect(line1, line2) {
	var a1:Number = line1[0];
	var b1:Number = line1[1];
	var a2:Number = line2[0];
	var b2:Number = line2[1];
	//
	var X:Number = (b2-b1)/(a1-a2);
	//trace(X)
	return (X);
}

Enemy.prototype.HitTest = function(line) {
	//Defining line (y=mx+b)
        var m:Number = line[0];
	var b:Number = line[1];
        //Defining point with coordinates (k,h)
	var k:Number = this.HitPos.x;
	var h:Number = this.HitPos.y;
        //
	var r:Number = this.R // = Radius of the enemy
	//
	var b2 = h-(m*k)
	//
	var m3 = -1/m
	var b3 = h-(m3*k)
	//
	var X2 = Intersect([m,b], [m3,b3])
	var Y2 = m3*X2+b3
	//
	dX = X2-k
	dY = Y2-h
	//
	var dist = Math.sqrt((dX*dX)+(dY*dY))
	//trace(dist)
	//
	if (dist < r){
		return (true)
	}else{
		return (false)
	}
	
};
It's been a while since I coded this and if I remember correctly a line (y = mx + b) is defined as an array [m, b]. The reason I went this way, is that I wanted to keep using the line definitions that were already in the game. Why they were there would be going to much into the gamespecific engine.

There was a webpage I based this on, but it was lost in a format of my system drive. I believe it was something like this:

Create a second line with the same slope as the first line, which goes through the point. With that just calculate the delta X and delta Y of the two lines. This can be easily done by resolving equations in which either y or x are known, which would be your points coordinates. Then just calculate your distance.

It's not your standard way of doing it (Ozmic did a fine job explaining that), but it got me my result using just lineair functions, which would allow me to make one definition of a line and reuse that troughout my code.