I am writing an application in Flex 4.
I created an HGroup like so:
<s:HGroup id="hgMods">
</s:HGroup>
Then, in Actionscript, I am looping over a collection and adding radio buttons dynamically to a RadioButtonGroup. Then, I want to add that RadioButtonGroup to the HGroup.
Here is my current code:
var rbg:RadioButtonGroup = new RadioButtonGroup();
for each (var obj:[some object] in [some collection]) {
var rbGroupName:RadioButton = new RadioButton()
rbGroupName.label = obj.[some named value].toString()
rbGroupName.group = rbg;
}
Now, how do I add the RadioButtonGroup to the HGroup?
I tried hgMods.AddChild(rbg);
When I did that, I got the error:
1067: Implicit coercion of a value of type spark.components:RadioButtonGroup to an unrelated type flash.display:DisplayObject.