Radio (and check boxes) in the UI controls is a bit tricky. You can use them for forms and such, and it is expected, but it takes a slight bit of jiggery pokery to get them to send their data out.
So let's say you have 2 radio buttons, one for "yes" and one for "no". Place these instances on your stage and click once on one of them, we will stick with the "yes" for now.
With it selected open the properties panel and select "Parameters" The only 2 parameters you really need to be worried about here are "selected" and "groupName". If you want "yes" selected by default, then change false to true. otherwise leave it false. For the groupName, give it a name, anything you want, this name will affect every radio button with the same name.
With that done, give it an instance name. Let's name it "radio1". Now we can add some action script:
Code:
on(click){
_root.radio1 = "YES";
}
Because it is a UI component, when it is clicked it will be selected, no matter what, what we are doing here is telling it that there is a value for the selected, and that value = "YES".
Do the same thing for the "no" radio button, and make sure they have the same groupName, if not then they can both be selected at the same time... that would be bad.
So now you want to get the value on the form to show up on the next frame in an out put window (or where ever), now you just call it...
Code:
var radioTxt = "_root.radio1";
Then when the radio button is selected and the movie loads a dynamic text box with a var of "radioTxt" it will show either "YES" or "NO" (or whatever you make them equal too)
If you are coding in AS3, then forget the _root and use the absolute location of the UI component.
Bookmarks