private function sumAll():void
{
var totalValue:Number;
for each(var rbg:RadioButtonGroup in [radiogroup1, radiogroup2, radiogroup3,radiogroup4, radiogroup5, radiogroup6])
{
totalValue+= rbg.selectedValue; // if these are strings be sure to parseInt(rbg.selectedValue)
}
firstLabel.visible = firstLabel.includeInLayout = secondLabel.visible = secondLabel.includeInLayout = thirdLabel.visible = thirdLabel.includeInLayout = false;
if(totalValue>10)
{
//Alert.show("You had more than 10");
firstLabel.visible = firstLabel.includeInLayout = true;
}
else if(totalValue<=10 && totalValue>5)
{
//Alert.show("You passed");
secondLabel.visible = secondLabel.includeInLayout = true;
}
else if(totalValue<=5)
{
//Alert.show("You failed");
thirdLabel.visible = thirdLabel.includeInLayout = true;
}
}
]]>
</mx:Script>
<s:RadioButtonGroup id="radiogroup1"/>
<s:RadioButtonGroup id="radiogroup2"/>
<s:RadioButtonGroup id="radiogroup3"/>
<s:RadioButtonGroup id="radiogroup4"/>
<s:RadioButtonGroup id="radiogroup5"/>
<s:RadioButtonGroup id="radiogroup6"/>
<s:Label text="Winner winner chicken dinner" id="firstLabel" visible="false" includeInLayout="false"/>
<s:Label text="You passed" id="secondLabel" visible="false" includeInLayout="false"/>
<s:Label text="You failed" id="thirdLabel" visible="false" includeInLayout="false"/>