Exit animation on layer when closed?

I want to do something that seems simple on the surface, but that I can't seem to implement.

If I have a layer that is opened by clicking a button, and then closed by clicking a button on the layer, is there a way to have an exit animation that happens WHEN THE LAYER IS CLOSED, as opposed to at a specific time on the timeline?

If so, how?

Thanks!

7 Replies