Set variable to object contents?

Apr 09, 2021

I've got a set of four radio buttons each with long(ish) content. e.g.,:

  • Lorem ipsum dolor sit amet, consectetuer elit.
  • Maecenas porttitor congue massa a tellus.
  • Purus lectus malesuada libero, sit amet.
  • Nunc viverra imperdiet enim. Fusce est.

When the user clicks on one of the radio buttons, I want to set a variable (e.g., var01) to the value of that button's content.

So, for example, if the user clicks on radio button 2, the variable would be set to "Maecenas porttitor congue massa a tellus."

I can do this by setting the variable to the value, of course:

set var01 to value Maecenas porttitor congue massa a tellus.

But the finished course will have 160 or so radio buttons, and it would be MUCH easier if I could do something like the following:

set var01 to value radio_02.text

Is this possible? I've scoured these forums for an answer, but wasn't able to find one. (It's entirely possible that I missed it, though, so apologies if so.)

Thanks

Christien

3 Replies
Christien Lee

Thanks, Walt.

That would boost my variable count into the low hundreds, which I'd prefer to avoid (not least because SL's variable creation and editing approach is a bit clunky), but it would definitely be easier than entering the value each time.

Still, if it were possible to reference the .text value of an object directly, that would be good to know going forward. Anyone?


Thanks again.