// This will have the first button selected.
<mx:RadioButtonGroupd id="radiogroupZ" selectedValue="somethingHere1"/>
<mx:RadioButton x="10" y="608" label="Button 1" value="somethingHere1" groupName="radioGroupZ"/>
<mx:RadioButton x="10" y="608" label="Button 1" value="somethingHere2" groupName="radioGroupZ"/>
<mx:RadioButton x="10" y="608" label="Button 1" value="somethingHere3" groupName="radioGroupZ"/>
// To select something in a function
private function functionName():void
radiogroupZ.selectedValue = "somethingHere1";
Thanks so much. That did the trick. The one odd thing is that the compiler keeps giving me an error when I save which reads:
1120: Access of undefined property radiogroupZ.
The script works fine however but this error persists in the "Problems" tab. I quit Flex, open it back up and the error comes back in there upon the next time I save the application. Again, the script does work but Flex keeps giving me this error message. Any ideas how to get rid of it?
If you added value to your radio, and you're calling a value that does exist I'm not sure why it'd throw an error.
Have you tried cleaning your project?
In flex builder click Project
Then click clean...
I'd be checking the case and spelling of the radiogroup name and the call is consistent...its always the dumbest things that catch us out.
Ya, I just cleaned it and no change. Again, the function works fine. It's called when a particular state is changed. Yet the error message persists.
The radiogroup is embedded in a form. I've attached a picture of the form code and the function code with error. It's no big deal I guess if the error never goes away as long as the function works.