PDA

View Full Version : verifying radio button values?


mlaurenc@thewor
10-23-2004, 03:58 PM
Hi all,

Can anyone help me with some radio button dilemmas? I have five questions on a form, and each has three radio buttons associated with it, Yes, No and Not Sure. I have them all set up correctly in groups, named, etc. Now there are two problems, both potentially dum-dum in nature.

In the first incarnation of this quiz, it was a standalone .swf that loaded in above the main movie. This worked fine (not the code, but everything showed up fine, etc). Now they want it rolled into the main movie rather than loading separately, so I've put it in a movie clip that slides onto the screen when a button is clicked. However, now when it shows up, there are no radio buttons at all, just white boxes where the buttons and associated label fields should be.

Here's what it should look like (and does, in my .fla):
http://www.mattlaurence.com/crap/quiz1.jpg

Here's what it looks like when I test the movie:
http://www.mattlaurence.com/crap/quiz2.jpg

Can anyone tell me what I'm doing wrong here to get this result? I've never seen it before - can radio button components not be nested deep within movie clips? This is weird, and I can't seem to figure it out.

That's my main problem. However, I also have some actionscript issues.

All buttons start off false, leaving the user to choose one before anything is selected, which is by design. What I want to do is have a submit button that will make sure that a value has been assigned to each of the five groups before moving on - but I can't seem to get that to work. Is there a way to get a general value for a button group, make sure it's set to SOMETHING, and use that value?

Any help would be most appreciated - thank you in advance!

Matt
mlaurenc@theworld.com
mattlaurence@gmail.com

hangalot
10-25-2004, 02:17 PM
the first thing i would say is to due u publishing for an older flash player version maybe.
as to the second 1, you could assign a listener for the click event to each group, let that event handler set a var and until all 5 the vars are true you would disable the button.

kumavds
10-28-2004, 04:16 AM
I've had some issues with Comboboxes and embedded swfs and the solution was to add the Combobox component to the parent fla. You could try adding the radiobox component to the parent fla and it may resolve the issue.

As for making sure something is entered for each question, check the radiobuttongroup.selection contains a value. If it is undefined then a radiobutton is not selected.