PDA

View Full Version : Contained MC code



Beatle
April 21st, 2010, 11:53 PM
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.

randomagain
April 22nd, 2010, 09:05 AM
read up on OOP

I'd say make an array, and log when a player completes a room, so then if the player returns to a completed room a code is ran

if(roomComp == true){
chest.open()} else{
chest.close()
}

storing stuff in a MC aint always a good thing.