The simplest way of doing this is creating a rect object and using Rect.Contains().
//example:
var rect = new Rect( x , y , width , height);
function HitTest(point : Vector2) {
if (rect.Contains(point)) {
print("The point is inside our rectangle");
}
}
Oh and by the way, in your original code, its only inside if all the conditions are true so you need and && instead of an ||.