serious animation problem!

its my last question in this forum so pleas guys anyone answer it…

i wanna to go to an animation to anther so how can i make that when the first animation is done like that

function Start(){
animation.wrapmode = Wrapmode.Loop
animation["GoingToRun"].wrapmode = Wrapmode.Once
}
if(Input.GetKey("w")){
animation.CrossFade("GoingToRun");
if(!animation.IsPlaying("GoingToRun")){
animation.CrossFade("Run");
}
}

And How can i make the path movement to the animation

The best way to set that up is in a state check set up

var target : Transform;
var shootRange = 20.0;

private var keepDistance = 10.0;

private var rotationSpeed = 5.0;

private var speed = 0.01;

private var state = “PATROL”;

function Start() {

Patrol();

this.animation[“shoot”].wrapMode = WrapMode.Loop;

this.animation[“run”].wrapMode = WrapMode.Loop;

this.animation[“idle”].wrapMode = WrapMode.Loop; }

function Update (){

if (CanSeeTarget ()) {

	 if(CanShoot()) {

 		state = "SHOOTING"; 

		animation.CrossFade("shoot"); 

		speed = 0.00; 	

		Shoot(); 
	} else {
		state = "PURSUE";

		 animation.CrossFade("run");

		 speed = 0.08;

		 Pursue(); 
	}
} else { state = "PATROL";

	 if (!animation.IsPlaying("idle")) {

		 animation.Play ("idle"); 

		 speed = 0.00; 
	}
 Patrol();

}

}

from here you would fill in the if statements with your get button and allow it to run the functions you need to set up below