Stopping all movement along axis?

Is there a way to stop all movement when a button is pressed.

So what I would like to do is when I play an animation, with the Input of a button, the character stops moving along any axis.

function Update () {
      if(Input.GetMouseButton(0))
      animation.Play("my_animation");
}

If there is a way, what should I add in to stop all movement on the input of a key?

Thanks for any incite into this!

animation.Stop(); stops all currently active animations, but also rewinds it. If you want to pause an animation, you will need to set its speed down to zero.

for (var state : AnimationState in animation) {
    state.speed = 0;
}

Be careful though, the animation is still “playing”, so if you want to play it again, you just need to set the speed to 1 (normal) again.