animation problem

function Start(){
animation[“I2J”].wrapMode = WrapMode.Once;
animation[“I2R”].wrapMode = WrapMode.Once;
animation[“R2J”].wrapMode = WrapMode.Once;
animation[“R2I”].wrapMode = WrapMode.Once;
animation[“R”].wrapMode = WrapMode.Loop;
animation[“I2J”].speed = 2.6;
}

function Update(){
var other : Movement = gameObject.GetComponent(Movement);

//Run animation
if(Input.GetKey("w") && !animation.IsPlaying("I2J") && !animation.IsPlaying("J")&& !animation.IsPlaying("R")){
animation.CrossFade("I2R");
animation["I2R"].speed = 3;
if(!animation.IsPlaying("I2R")){
animation.Stop("I2R");
run();
}

The I2R is reapiting and the run function didnt happeen?!

You start the animation all the time - it never has a chance to complete because you Crossfade it in every time.

 Perhaps:

  var startedI2R = false; //Script variable
  ...

  if(!animation.IsPlayer("I2R") {
       if(!startedI2R) {
           animation.CrossFade("I2R");
           animation["I2R"].speed = 3;
           startedI2R = true;
        }
        else {
           startedI2R = false;
           run();
         }
   }