Skip navigation
todaco
Currently Being Moderated

Change fill of text object depending on radio button selection

Jul 17, 2012 12:53 PM

Tags: #color #button #fill #radio

Hi,

 

This should be fairly easy for most of you to answer. I am trying to fill one of two text objects depending on the radio button selection. Here is the code I have

 

If (RadioButtonList.Value == "Accept")

 

TextAccept.border.fill.color.value == "255,255,0";

 

else TextDoNotAccept.border.fill.color.value == "255,255,0";

 

Don't know why this is not working but I'm sure one of you will figure it out quickly.

 

Thanks in advance!

 
Replies
  • Currently Being Moderated
    Jul 17, 2012 3:06 PM   in reply to todaco

    You've got a few mistakes...Value should be rawValue for RadioButtonList.

     

    There should only be 1 equals signs for the color assignment statements. "=" assigns a value, "==" tests a value.

     

    And then it's always a good idea to put in the curly braces, althought I think for single statements it will work without them.

     

    If (RadioButtonList.rawValue == "Accept") {

              TextAccept.border.fill.color.value = "255,255,0";

    }

    else {

              TextDoNotAccept.border.fill.color.value = "255,255,0";

    }

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points