On Click Animation Issues

Hi

So Im making a new game, my first game aswell but I am struggling to make my code work. I do have experience in visual basic so im not a complete noob but i have never done unity. Anyway I have a sledge hammer and have made an animation, I just cant get my code to work. Here it is so far but I get the error: NullReferenceException: Object reference is not set to an instance of an object. Here is my current code

function Update ()
{
var hammerswing : AnimationClip;

	 if(Input.GetMouseButtonDown(0))
 transform.Animation.Play("Hammerswing");

}

Try using transform.animation.Play("Hammerswing"); with lower case animation, and be sure that there is an animation component on the same gameObject as the script.