Basic Animating

Alright so I'd imagine for most of you this would be pretty simple. I have my moving around script all nice, but now it's time to add some attacks. Im not worried about colliders or damage, or any of that atm, I just want to know how I can switch to the animation of the attack, and then switch back to the idle animation. So far, he can switch to the attack, but after the animation finishes he'll just stay put on the last frame (and yes, I do have it on ClampForever). Heres the script, please help! Note that the attack will spawn a projectile on a specific frame, but dont worry about that right now.

Variables:

private var isCasting:boolean = false;

For the Function Update - Checking if he's Casting:

if(isCasting)
        {
            isMoveable = false;
            isWalking = false;
            animation.CrossFade("meteor");
        }else{
            isMoveable = true;
        }

Control to make him cast:

if(isCasting == false)
    {
        if(Input.GetKeyDown("1"))
            isCasting = true;
    }

maybe you need to see more about animation http://unity3d.com/support/documentation/ScriptReference/Animation.html here you can find Play,Stop,isPlaying and many other things. I dont what you want exactly but It would be better to try something like this:

if(Input.GetKeyDown("1")){
isMoveable = true;
}
if(Input.GetKey("1")){
animation.CrossFade("meteor");
}
//or put if(isMoveable == true){animation.CrossFade("meteor");}
if(Input.GetKeyUp("1")){
isMoveable = false;
}
if(isMoveable == false){
animation.CrossFade("idle");
}