PDA

View Full Version : problem related to removing movieclips after they are discovered in a game


dna
12-06-2007, 06:12 PM
I did a search for this and though there are a few threads concerning this or a similar problem, none of the proposed solutions seem to be working (or I'm just missing something).
The attached .fla is a simplified illustration of the problem I'm having with a much larger project for school. It's a point and click game, and obviously needs some kind of inventory. I thought I had it worked out and went ahead and did a lot more work on the game before realizing that there's a bug in my inventory that I can't figure out how to work around.

In brief: There are two movie clips on the stage. One is called box_mc and represents the "rooms" in my game. It has two keyframes inside it, one for each view of the "rooms" (in this case, represented by the fact that the box is a different color in each view). Each also contains a navigation button to move you back and forth between each room.

The second movie clip on the stage is an inventory (inv_mc).

The first room contains an instance of an object (circle1_mc). When you press it, it's visibility gets toggled to false and a second instance of the object (circle2_mc) contained inside inv._mc is toggled to visible. This is supposed to represent that you have now "found" the object.

There is also a text field on the stage that describes the status of the object ("found" or "hidden").

My problem is twofold: If you "find" the object and travel to the next room, it remains in the inventory (good!). However, once you return to the original room, while circle2_mc remains visible in the inventory, circle1_mc reappears!

I put in an "if circlelocated==found" statement, and now what happens when you renter the first frame is that circle1_mc flickers on for a second and then disappears.

I've tried this in other ways -- unload movie, just moving the clip off the stage, etc. Nothing works. Every time I reenter the first frame, it reappears.

Weirdly as well, if you travel to the second room and then revisit the first room, even though circle1_mc is visible, it is no longer responsive to onPress. I don't have this problem is my real project so I don't know what the hell the problem is there.

Any advice appreciated, thanks.

yenniie
01-24-2008, 06:19 PM
place stop(); in the first frame. it loops that's why the circle still shows