How to play an animation on collision ONCE Only!?

My animation plays but it will not stop playing on collision … Please someone help me so this script plays just ONCE on collision with player and then stops… Returns to idle

This is a 2d game and javascript MY Animation will not stop playing , I have so far

1 checked all loops OFF

2 checked for wrap modes set all to “once”

3 Checked and made sure it is not my default animation

heres my simple script below
I also have mecanim setup but all loops check boxes are unchecked

 var animator : Animator;
      var pow: AudioClip;
      var fingersslap: AnimationClip;
     function Start () {
         animator = GetComponent("Animator");
         animation.clip = fingersslap;
     audio.clip = pow;
         function OnCollisionEnter2D(coll : Collision2D) {
          if (coll.gameObject.tag == "Player") {
20.              Debug.Log("collision detected");
25.        animation.Play("fingersslap");

I notice you could be mixing Animation types.

Animator and Animation are two separate components.

For animator component you need ‘Animator’ and to create a Controller file which is linked in the first element of the component. Open the Controller file in the Animator window and edit it from there, linking from script.

Mechanim works for Generic and Humanoid Animation types.

‘Animation’ component is for Legacy animation.

Also, Use GetComponent(Animator) instead of (“Animator”)