Animation Error "Null reference exception"?

I am building a FPS (not the tutorial) and I built a series of animations for a gun model using Maya (a .mb file). I have imported the animations, and written a basic script that runs the bolt slide animation when you click the mouse (and fire the weapon) here is the script:

function Update ()
{
    if(Input.GetButtonDown("Fire1"))
    {   
        animation["Element 0"].wrapMode = WrapMode.Once;
        animation.Stop();
    }
}

however, when I run this script, I get a "Null reference exception" message in the debug window, what is the error?

Thanks

Most likely there is no animation by the name of "Element 0". Or, the game object that you have attached this script to doesn't have an animation component attached to it at all.

Wow, I just used the animation.Play command and it works fine, case solved. Now, I wonder what the difference between wrapMode and play is...