help with animations done in scripting

this NOOB (AKA me!) is having a problem with his animations.So i'm programming in javascript that if my animation is done that it needs to shoot. now the problem isn't the shooting part it is the if done part.

you see I get an error that says that I cannot Quote: invoke an expression of UnityEngine.Animation)UnQuote.

if that is not enough here is my script.(well part of it atleast)

if(Input.GetButtonDown("X"))
{
animation.CrossFade("Shoot");
}
if(animation("Shoot").isDone)
{
var bullet = (bulletPrefab, transform.Find("X").transform.position, Quaternion.identity);

bullet.rigidbody.AddForce(transform.forward * bulletSpeed );
}

There is no `isDone` property in any of the animation API. When scripting, you can't just write some words that you hope will do what you need; you have to look up in the scripting API which functions and properties are actually available and use those.

To test if an animation is playing, you can use Animation.IsPlaying():

if (animation.IsPlaying("Shoot")) {
    ...
}

You seem to be missing the word "`Instantiate`" after "`var bullet =`".

You also need to change the if statement to this

if( animation[ "Shoot" ].isDone )