Simple Radio Buttons
Simple Radio Buttons
How to evaluate the current selected radio button option.
Add a simple common button object to your frame and change the type to "Radio Button"

Add 3 texts lines for our radio button options

Here we just have
Option 1
Option 2
Option 3

Then just add a simple string object and our frame should look like this

Now lets jump over to the event editor and make a series of events to do the following: Change the string object to tell us what radio button is currently selected.
Radio buttons start at 0 -- so that is something to keep in mind.
Event 1:
Conditions:
Start of Frame
Actions:
[Button] - Set Radio button - Select a radio button - {0}
[String] - Set Alterable text to - {""}
Event 2:
Conditions:
[Special] - Compare 2 general values - [Button] Value of set radio button = "0"
Actions:
[String] - Set Alterable text to - {"Option 1 selected"}
Event 3:
Conditions:
[Special] - Compare 2 general values - [Button] Value of set radio button = "1"
Actions:
[String] - Set Alterable text to - {"Option 2 selected"}
Event 4:
Conditions:
[Special] - Compare 2 general values - [Button] Value of set radio button = "2"
Actions:
[String] - Set Alterable text to - {"Option 3 selected"}
If this seems confusing try looking at this example file.
Download Example File
- Login or register to post comments
Printer-friendly version
Send to friend



Comments
Nice tutorial. I finally worked out how to do something with radio buttons....