PUZZLE GAME anyone?

Hi guys pls view the attached files…I am doing a game using the same concept is there anyway to detect the value of the remaining squares easily?

When the users click the squares it will go up and the value will be 0 but if the square is in the start position then its 1 or any value because its true. also imagine if there were more boxes around and users will need to build base on a diagram how would u guys solve it? thanks.

the only way that I know of is using if and else if but I’m sure there has to be an easier way…the file is in flash mx 2004 format if you need it in an older format please do let me know… thanks.

Kelvin