Animation loop noob Problem

Hello Right now im trying to use this. this is the script that is just receiving everything

var targetHand: GameObject;
var Up: MouseEnterUp;
var Down : MouseEnterDown;
var ContA : int = 0;
var ContB : int  = 0;

function Start(){
    targetHand= GameObject.Find("As_Hand");
    Up= GameObject.Find("CubeUp").GetComponent(MouseEnterUp);
    Abajo = GameObject.Find("CubeDown").GetComponent(MouseEnterDown);
}
function Update()
{
   if(Up.EnterA == true)
   {
    ContA = 1;
   }
   if(Down.EnterB == true)
   {
   ContB = 1;
   }

   if((ContA == 1) && (ContB == 1))
   {
      targetHand.animation.wrapMode = WrapMode.PingPong;
      targetHand.animation.Play("Clean"); // name of the animation clip 
      ContA=0;
      ContB=0;
   }
} 

this is the code that calls EnterA this is another script EnterB is the same thing except that the var is named EnterB and the script is also named different but thats about it

var wasClicked : boolean;
var EnterA: boolean = false;
function Update()
{
if(Input.GetButtonDown("Fire1"))
{
wasClicked=true;
}
else if(Input.GetButtonUp("Fire1"))
{
wasClicked=false;
Deactivate();
}
}

function OnMouseEnter() {
    if (wasClicked) {
        Activate();
    }
}

function OnMouseExit() {
    Deactivate();
}

function Activate() {
    EnterA = true;
}

function Deactivate() {
    EnterA =false;
}

The animation is playing at first when A and B are both 1 then it loops infinitely any ideas? thank you very much

This may be the cause (or start of it):

targetHand.animation.wrapMode = WrapMode.PingPong;

With PingPong, the animation doesn't really automatically stop. So unless you explicitly tell it to, the animation won't stop. It would just 'ping pong' back and forth between its beginning and end.

woah woah woah! surely this is unnecessary. you've got 2 scripts to look for buttonUp and buttonDown events and flag a boolean variable? Surely you dont need that. What are you trying to do?

It looks like you're just trying to play an animation when the user holds down 2 buttons?

Unless I don't understand something that you're trying to accomplish, you should be able to just use this and only this (frankly, this is probably already a little sloppy):

var hasPlayed : boolean = false;
var targetHand= GameObject.Find("As_Hand");

    function Update()
    {
       if(Input.GetButton(x) && Input.GetButton(y) && !hasPlayed)
       {
          hasPlayed = true;
          targetHand.animation.wrapMode = WrapMode.PingPong;
          targetHand.animation.Play("Clean"); // name of the animation clip 
       }
       if((Input.GetButtonUp(x) || Input.GetButtonUp(y)) && hasPlayed)
       {
          hasPlayed = false;
          targetHand.animation.Stop();
       }
    }