Reverse animation problem

My basic script:

function OnTriggerEnter(collision : Collider) {
    affectedObject.animation[animationName].speed = 1;

function OnTriggerExit(collision : Collider) {
affectedObject.animation[animationName].speed = -1;

affectedObject is the Object I am applying the animation to.

This item acts like a button. OnTriggerEnter (activated) the animation starts.

OnTriggerExit (deactivated) the animation plays in reverse.

The animation works correctly IF the button is deactivated before the animation finishes. Otherwise, when deactivated, the platform falls back instantly.

What I hypothesize

Once an animation completes, the animation time is reset to 0. How can I get around this?

affectedObject.animation[animationName].time = affectedObject.animation[animationName].length;

if the animation completes.