Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 01-27-2010, 08:48 PM   #1
Sonok
Username: Sonoka
 
Join Date: Jan 2010
Posts: 3
Default [AS2] check if the variables are located or not

I'm playing around a little in flash cs4, trying to make a room escape game.
Kinda silly, but I gotta start somewhere. And then I stumbled across a problem, if I have a 'board' with 5 x 6 tiles, (30 tiles.. all already converted into MC's, given instance names). I put in a little code, that will hide the tile when clicked, and show the tile under it, and if you click the one below, the top one will come back. So it's kind of a puzzle.
I need help with a script that will check if the variables are located or not, and if the 3 correct tiles are 'not located' when I press a button, then it will show another movie clip on another screen. I thought, I could give all 30 tiles variables, and then check the located / not located.
And my problem is:
1. I'm not sure if I should make variables of all of them.
2. I don't know how I could check on all the 30 variables within 1 script.
3. I don't know how to do the check, with just one press of a button.

Thanks in Advance
//Marcus


Edit: Oh, wrong forum I guess! Sorry for that[=

Last edited by Sonok; 01-27-2010 at 09:06 PM.
Sonok is offline   Reply With Quote
Old 01-28-2010, 06:42 AM   #2
Sonok
Username: Sonoka
 
Join Date: Jan 2010
Posts: 3
Default I know my question is confusing, probably, anyway..

I'm not here for a complete code, just some hints and tips if this is doable.
Guess this is a minor bump, but also just to clarify my problem.

I have 60 tiles total. 30 red on top of 30 green. When the red one is clicked it will change to visible=false, and when the green one is clicked it will change the red tile above it to visible=true.
What I do want to know, is how I program a button to check if the 3 correct red tiles are visible=false AND the other 27 red tiles visible=true, so a player just can't press all of them and still clear.
Let's say I want tile 2, 7 & 18 to be the ones that should be visible=false.
I thought of making variables, but then I'd need 1 unique one for all 30 red tiles, is that the way to go?
They all have a unique instance name already, btn_1 - btn_30, tried to make an if statement with the 3 tiles I wanted to be false, and the 27 I wanted to be true. And an else statement that resetted all tiles to visible=true if the wrong tiles were pressed. But ofcourse.. with no success.

Also having problem keeping the movieclip, that I want to hide until the correct combination is pressed, hidden.. it keeps showing if I reload the screen when I test play my game.
The problem with the movie clip is that it's in a diffrent frame then the actuall button, and I don't know how to root it, I'v tried several things.. but I guess it will be easier when I get the button to work along with the code aswell.


Thanks in Advance
//Marcus

Last edited by Sonok; 01-28-2010 at 06:43 AM. Reason: Spelling*
Sonok is offline   Reply With Quote
Old 01-31-2010, 07:45 PM   #3
Sonok
Username: Sonoka
 
Join Date: Jan 2010
Posts: 3
Default .

I dismiss this thread, lock it or delete it. I solved the problem on my own, thanks anyway.
Sonok is offline   Reply With Quote
Reply


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 09:26 AM.

///
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.