The Daily Click ::. Forums ::. Klik Coding Help ::. Radio Button not working in project?
 

Post Reply  Post Oekaki 
 

Posted By Message

infinitum3d



Registered
  03/03/2012 22:18:24
Points
  66
14th February, 2013 at 14/02/2013 20:09:55 -

Hi!

Does ENABLED mean 'selected' in the case of Radio buttons?

I created a radio button with three choices. When choice one is selected, I want a string to display paragraphe 1, when the second option is selected display paragraph 2, and option 3 paragraph 3.

Simple right? But it doesn't work. It loads paragraph 1 at the start of the frame, and even though I click through the three options, the paragraph never changes. In fact, when I set it up, it says "Enter the number of the button" even if I say 4,and check the current expression, it says "Valid expression". How can 4 be valid when there are only 3 choices?

I must not understand radio buttons. Since I have three options, how do I get it to react to changing the selection?

I currently have it set up as:

.(if)
Radio button 1 of [Button] is enabled
[string]
Display paragraph 1

/next event/
.(if)
Radio button 2 of [Button] is enabled
[string]
Display paragraph 2

So if Radio button 1 is selected, it should display paragraph 1, right? Unless my syntax is wrong. Is ENABLED and SELECTED the same?

Thanks!

UPDATE: well for one thing I learned that the buttons are numbered like an array, 0, 1, 2 not 1, 2, 3. Maybe that will help me figure it out...

UPDATE 2: so I figured out ENABLED and SELECTED do NOT mean the same thing. My problem now lies in the fact that there is no event for
(if) RADIO BUTTON SELECTED...

Hmmm... I'm getting closer.

UPDATE 3: I think I need to set a global variable to the value of my set radio button. Since I cannot figure out how to pull the value directly from the radio button, but I can set a variable to the value of the radio button... Seems like an unnecessary step, but unless anyone else has any suggestions, I suppose it will work.

UPDATE 4: YES! That works. Now I have it set up as;
Always>set(globalValueOfRadioButton)to Selected Radio(".")

Then, when I need that value, I use the global variable rather that the actual radio button. It works.

Edited by infinitum3d

 
n/a
   

Post Reply



 



Advertisement

Worth A Click