Community

Escape game AS. Need help with inventory.

Posted Jul 29, '10 at 7:08pm

Kynia

Kynia

9 posts

Iron - Serf

Hey. I'm Kynia and I've been looking for some help with a problem I've come across in a game I'm making. Which you can click on the link here.

http://www.newgrounds.com/dump/item/f614d8af5be6146870b41dae50316cab

Basically, the problem is that when you click on an item and it appears in your inventory. Now when you leave to go to the other side of the room (the next frame) and then come back the (previous frame) items reset themselves. I'm looking for the simplest way to do this. Of course in that clip, I had newbishly was just using go to so and so frame in the movie clip to appear the item was gone.

I made this separate file to test out a code to see if I could get past this problem, so I could apply it to my game.

http://www.newgrounds.com/dump/item/757e04f0d08be34d0905759168fbb4c2 -Swf file

http://www.newgrounds.com/dump/item/53d6cd5b128cda3d6b7ef049f0615a6a -fla file

Though same problem though the coding I was using on a separate layer for the first frame is this.

stop();
pil._visible=false;
pil2.onpress=function(){
pil._visible=true;
pil2._visible=false;
}

Posted Jul 29, '10 at 7:11pm

Kynia

Kynia

9 posts

Iron - Serf

Oh, also I'm working with Flash MX 2004 just so you know (Ah, yes kinda old, though least it wasn't a much older version I had.)

 

Posted Jul 29, '10 at 7:29pm

Darkroot

Darkroot

2,438 posts

Wood - Prince

You could create a check that checks if pill is in the inventory to not make it visible.

stop();
if (pill in inventory)
pil._visible=false;
pil2.onpress=function(){
pil._visible=true;
pil2._visible=false;
}

 

Posted Jul 30, '10 at 1:01am

Kynia

Kynia

9 posts

Iron - Serf

It's my first time making a game like this and any step by step tutorial I've read hasn't really explained how to make the item you found stay invisible when going to another frame.

 

Posted Jul 30, '10 at 1:20pm

Darkroot

Darkroot

2,438 posts

Wood - Prince

You might want to not put all the code in frames but on a separate layer.

 

Posted Jul 30, '10 at 1:35pm

Secretmapper

Secretmapper

664 posts

Wood - Lord

You might want to not put all the code in frames but on a separate layer.

Easiest way

 

Posted Jul 30, '10 at 3:06pm

Kynia

Kynia

9 posts

Iron - Serf

It is on a separate layer. I usually keep them on a layer named 'actions' away from my movie clips.

 

Posted Jul 30, '10 at 3:50pm

Darkroot

Darkroot

2,438 posts

Wood - Prince

Yes but are you coding on the key frames on a separate layer, because it's the same problem.

 

Posted Jul 30, '10 at 4:01pm

Kynia

Kynia

9 posts

Iron - Serf

Sorry, then I'm not quite following then, even though I'm on a separate layer it's still not right?

I'm not exaclty an intermediate flash user, unfortunately and looking for an over all simple solution. A lot of tutorials haven't really went into a lot of depth about this out of so many I've read.

 

Posted Jul 30, '10 at 11:16pm

rjbman

rjbman

219 posts

Iron - Squire

So you're programming on the main timeline?

 

Posted Jul 31, '10 at 3:07pm

Darkroot

Darkroot

2,438 posts

Wood - Prince

No I think hes coding in the frames.

 
Reply to Escape game AS. Need help with inventory.

You must be logged in to post a reply!