Contained MC code

Hi there, I’m pretty new to flash so this may be a basic question, but I’ve had no luck so far.

I’m trying to make a game with a treasure chest in it, I want it so when a player open’s the chest then leaves the room and returns the chest remains open.

The problem I have is that I want the chest movie clip to handle it, and be completely self contained, so that I could use the same movie clip and not have to worry about making new variables for every one.

If I go to a another frame then back, it resets to the closed position.

Any ideas?

Thanks.