Home Tutorials Forums Articles Blogs Movies Library Employment Press
Prev Previous Post   Next Post Next
Old 02-17-2012, 10:58 AM   #1
DarkShadow
Registered User
 
Join Date: Feb 2012
Posts: 2
Default [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!
DarkShadow is offline   Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:34 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.