Jump to content

Toggles Overrides, Question


dariosaquetti

Recommended Posts

Hello All

I am trying to create 3 toggles, A,B,C and when A is on it turns the others off. B on the rest off, C on the rest off.

I wrote this code, but somehow it isn't working fully. Just works when I click on A, it deactivates the rest, but not on B or C. Not sure why it isn't working . I'd be grateful if you can help. I am far of being the best coder. 

Thanks!

 

int toggleA = chi("ToggleA");

int toggleB = chi("ToggleB");

int toggleC = chi("ToggleC");

if (toggleA == 1) {
   
    toggleB = 0;
    toggleC = 0;
} else if (toggleB == 1) {

    toggleA = 0;
    toggleC = 0;
} else if (toggleC == 1) {

    toggleA = 0;
    toggleB = 0;
}


setattrib(0,"detail","toggleA", 0, 0, toggleA );
setattrib(0,"detail","toggleB", 0, 0, toggleB );
setattrib(0,"detail","toggleC", 0, 0, toggleC );

Edited by dariosaquetti
Link to comment
Share on other sites

  • dariosaquetti changed the title to Toggles Overrides, Question

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...