Point system problem

I’m making a little game, pretty simple. But I don’t really know the programmation I usually understand the code but I’m not able to “create it”.

Here is my game I have a building with bad ans good windows (you dont see the difference between both). You must click on all good windows to win the game (I have something as 17 good and 7 bad). So you have 3 chance to do so. (Of course if you click on a good window you don’t lose a chance.) The only thing you see is the chance remaining.

I have a little code that is working:

on a bad windows:
on (press) {
_root.building_mc.bt1._alpha = 0;
_root.chance_mc.chance_txt.text -= 1;

}

on the chance remaining_mc
stop();
chance_txt.text = “4”;

the only thing I need to program is my condition and the variable for the good windows. 5 condition:

if chance_txt.text = 4 hide chance_mc
if chance_txt.text <=3 show chance_mc
if chance_tx.text <= 1 chance_mc go to and play frame 2 (put off the plurar on the txt)
if chance_tx.text =0 _root gotoand play frame 40

and finally the variable and the condition on the good windows.

I think thatit is not really complicated but when you don’t know the code it can be really hard.

thx

xelaxam