[AS3] point and click game trouble
Hey everyone,
I'm making a point and click game for school but I'm having some trouble working something out. So I want to make something like an inventory in my point and click game. You can pick a key in a room (keyframe) and it disappears from the room into the inventory. But when I go back to another room (keyframe) and back again to the room where you get the key, it's there again. It needs to stay invisible on that frame but it keeps coming back. This is the code I got for it:
var getkey:Boolean = true
key1_mc.addEventListener(MouseEvent.CLICK, gotkey);
function gotkey(event:MouseEvent) {
if (getkey==false){
key1_mc.visible = false
else (getkey=true){
key1_mc.visible = true
}
}
}
How do I solve this problem? Any ideas? It would be great if someone got a solution for this..
Thanks in advance!
|