Uncheck Checkbox

Get help using Construct 2

Post » Mon Apr 29, 2013 7:27 am

Hi All,

I'm fairly new to Construct 2, and its great.
I'm struggling with checking and unchecking checkboxes.

I trying to create a settings page.
As soon as you check the checkbox, a global variable changes from "inactive" to "active". Later I want to use this global variable.

So my goal is:
Check checkbox -> set global variable
Uncheck checkbox - > set global variable

I've uploaded what I have so far:
https://dl.dropboxusercontent.com/s/3ke4a1hmnahwt3v/checkbox.zip?token_hash=AAENdxrbtiqO0x_pmIpw-51YIuR8V_XwY_m6r9IglCuH1A&dl=1

Thanks in advance.

P.S. This forum needs attachment support so that uploaded files are accessible for ever
B
3
Posts: 3
Reputation: 181

Post » Mon Apr 29, 2013 5:14 pm

Like this?

B
55
S
29
G
19
Posts: 1,520
Reputation: 25,710

Post » Tue Apr 30, 2013 11:22 am

That was to easy

Thanks!
B
3
Posts: 3
Reputation: 181

Post » Mon Sep 25, 2017 11:37 am

Hi! This topic seems to be answered, however the answer is no longer appearing. My take on the issue is this. I should state I have many checkboxes and this is the way i find which one was checked.
/*
on checkBoxFunction
for each checkbox, set local variable localcheck to true
if localcheck is true
pick instance with uuid Function.Param(0), then set myTextBox text to "Checkbox with UID "&checkbox.UID &" was checked";
*/
checkbox Is checked call("checkboxFunction") with the parameter checkbox.UID

If someone has a better solution please provide it here
B
5
Posts: 4
Reputation: 237

Post » Mon Sep 25, 2017 12:18 pm

@kiki4construct
kiki4construct wrote:Hi! This topic seems to be answered, however the answer is no longer appearing. My take on the issue is this. I should state I have many checkboxes and this is the way i find which one was checked.
/*
on checkBoxFunction
for each checkbox, set local variable localcheck to true
if localcheck is true
pick instance with uuid Function.Param(0), then set myTextBox text to "Checkbox with UID "&checkbox.UID &" was checked";
*/
checkbox Is checked call("checkboxFunction") with the parameter checkbox.UID

If someone has a better solution please provide it here


You have pointlessly necro-posted in a thread that is over 4 years old.

The software has moved on considerably since then, as has the original poster, who hasn't been on this forum for 4 years.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
138
S
31
G
88
Posts: 5,637
Reputation: 61,205


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 30 guests