Animation is broken

Hi, I was trying to make a script for a SciFi like sliding door, I created 2 animations, one of which is the door just moving right, and the the other puts it back into place. My script uses OntriggerEnter and everything works fine except that as soon as I enter the collider, the door constantly opens and closes until I leave? The sound also constantly plays as if it actually is constantly opening and closing.
Here is my script if there is a problem in it:

#pragma strict

var DoorOpenAnimation : AnimationClip;
var DoorCloseAnimation : AnimationClip;
var DoorOpenSoundEffect : AudioClip;
var DoorCloseSoundEffect : AudioClip;

function Start () {

}

function Update () {

}

function OnTriggerEnter (other : Collider)
{
	animation.Play("DoorOpenAnimation");
	audio.PlayOneShot(DoorOpenSoundEffect, 1.0);
}

function OnTriggerExit (other : Collider)
{
	animation.Play("DoorCloseAnimation");
	audio.PlayOneShot(DoorCloseSoundEffect, 1.0);
}

Thank in advance for anyone who will help.

Okay, so the script is on the door. This is what I think is happening:

1: You walk into the door, so OnTriggerEnter fires. The door opening animation and sound starts playing.

2: Because the animation moves the door away from you, it stops being collided with you, and OnTriggerExit fires. The door closing animation and sound starts playing.

3: Because the animation moves the door towards you, it collides with you, and OnTriggerEnter fires. The door opening animation and sound starts playing.

4: See 2

Remove the script from the door, and add it to an invisible cube that’s around the door. Make sure the animations are still the ones on the actual door. That should fix your problem.