Uncheck Checkbox

  • 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:

    dl.dropboxusercontent.com/s/3ke4a1hmnahwt3v/checkbox.zip

    Thanks in advance.

    P.S. This forum needs attachment support so that uploaded files are accessible for ever <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Like this?

    <img src="https://dl.dropboxusercontent.com/u/8367729/construct/pics/toggleCheckbox.PNG" border="0" />

  • That was to easy <img src="smileys/smiley9.gif" border="0" align="middle" />

    Thanks!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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

  • kiki4construct

    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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)