Im trying to use a checkbox to separate 2 options, like if it is checked use this template if not use this. So far im able to do that and it changes color between A and B but now to my problem is that i would like the button to change to a third color if im in A or B.
so in my code now it shows blue and text "vänster if its checked and green and text "mitten" if its not checked, now i want it to be red on each option and with text "ta bort"
hope you understand

my code looks like this right now:
Code: Select all
on mouseUp
if the hilite of button "checkbox1" then
Set the label of me to "vänster"
set backgroundcolor of me to blue
put "CG 1-1 ADD 0 namn 1" into myVariable
put quote after myVariable
put "<templateData>" after myVariable
put "<componentData id=\" after myVariable
put quote after myVariable
// Name of the field in FLASH
put "namn" after myVariable
put "\" & quote after myVariable
put "><data id=\" after myVariable
put quote after myVariable
put "text\" after myVariable
put quote after myVariable
put " value=\" after myVariable
put quote after myVariable
// Name of the field in LIVECODE
put uniDecode (the unicodetext of field "namn1", "UTF8") after myVariable
put "\" after myVariable
put quote after myVariable
put " /></componentData>" after myVariable
put "</templateData>" after myVariable
put quote after myVariable
write myVariable & format("\r\n") to socket "localhost:5250"
else
Set the label of me to "MITTEN"
set backgroundcolor of me to green
put "CG 1-1 ADD 0 namn_mitt 1" into myVariable
put quote after myVariable
put "<templateData>" after myVariable
put "<componentData id=\" after myVariable
put quote after myVariable
// Name of the field in FLASH
put "namn" after myVariable
put "\" & quote after myVariable
put "><data id=\" after myVariable
put quote after myVariable
put "text\" after myVariable
put quote after myVariable
put " value=\" after myVariable
put quote after myVariable
// Name of the field in LIVECODE
put uniDecode (the unicodetext of field "namn1", "UTF8") after myVariable
put "\" after myVariable
put quote after myVariable
put " /></componentData>" after myVariable
put "</templateData>" after myVariable
put quote after myVariable
write myVariable & format("\r\n") to socket "localhost:5250"
end if
end mouseup