Adding only Value 1 after CheckBox check

For questions about using Classic.

Post » Thu Mar 24, 2011 12:23 pm

Hi,
i have no idea if this is supposed to be like this, but i have 3 checkboxes and i want if all 3 are checked let a message appear for example. My idea was simply to button1 is checked add 1 to global variable "counter"

and then if "counter" equal 3 BING MESSAGE appears. But the message appears if only 1 checkbox is checked after some time. I tested for example setting "counter" equal to 100 as a condition. The same thing, after some time, the message appears. This is because

button1 is checked add 1 to global variable "counter"

adds value 1 to the variable all the time and not just one time as i wish it would? Any ideas about how to fix this? Is this a bug or is it supposed to be like this? I tested it with displaying the variable in a text field and i was growing and growing....

Thanks for your time and help,

unknown1111
B
1
G
1
Posts: 9
Reputation: 443

Post » Thu Mar 24, 2011 12:43 pm

[quote="unknown1111":w09ehsmx]adds value 1 to the variable all the time and not just one time as i wish it would?[/quote:w09ehsmx]

The 'Is checkbox checked' condition will be always true if any instance of the button is checked as long as you don't use other actions to pick instances accordingly. So it will always add to the variable. This is NOT a bug.

To do an action for all instances of an object equally, it sometimes requires a For each loop. Take a look at the following cap, which (hopefully) works like you want:

[url:w09ehsmx]http://dl.dropbox.com/u/2306601/buttoncheck.cap[/url:w09ehsmx]
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,440


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest