# Contained MC code

**URL:** <https://forum.kirupa.com/t/contained-mc-code/308392>\
**Category:** programming\
**Created:** [April 22, 2010, 3:53am UTC](https://forum.kirupa.com/t/contained-mc-code/308392 "2010-04-22T03:53:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Beatle](https://avatars.discourse-cdn.com/v4/letter/b/8797f3/32.png) [@Beatle](https://forum.kirupa.com/u/Beatle)\
**Post date:** [April 22, 2010, 3:53am UTC](https://forum.kirupa.com/t/contained-mc-code/308392/1 "2010-04-22T03:53:38Z")

</div>

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.
