<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="middle"
backgroundColor="white"
creationComplete="init();">
<mx:Script>
<![CDATA[
import mx.containers.ApplicationControlBar;
import mx.containers.Form;
import mx.containers.FormItem;
import mx.containers.VBox;
import mx.controls.CheckBox;
import mx.controls.RadioButton;
import mx.controls.RadioButtonGroup;
private var checkBox:CheckBox;
private var radioGroup:RadioButtonGroup;
private var radioButton1:RadioButton;
private var radioButton2:RadioButton;
private var radioButton3:RadioButton;
private var radioButton4:RadioButton;
private var radioButton5:RadioButton;
private function init():void {
var appControlBar:ApplicationControlBar;
var form:Form;
var formItem:FormItem;
checkBox = new CheckBox();
checkBox.selected = true;
checkBox.addEventListener(Event.CHANGE, checkBox_change);
formItem = new FormItem();
formItem.label = "enabled:";
formItem.addChild(checkBox);
form = new Form();
form.styleName = "plain";
form.addChild(formItem);
appControlBar = new ApplicationControlBar();
appControlBar.dock = true;
appControlBar.addChild(form);
Application.application.addChildAt(appControlBar, 0);
radioGroup = new RadioButtonGroup();
radioButton1 = new RadioButton();
radioButton1.label = "Red";
radioButton1.group = radioGroup;
radioButton2 = new RadioButton();
radioButton2.label = "Orange";
radioButton2.group = radioGroup;
radioButton3 = new RadioButton();
radioButton3.label = "Yellow";
radioButton3.group = radioGroup;
radioButton4 = new RadioButton();
radioButton4.label = "Green";
radioButton4.group = radioGroup;
radioButton5 = new RadioButton();
radioButton5.label = "Blue";
radioButton5.group = radioGroup;
var vBox:VBox = new VBox();
vBox.addChild(radioButton1);
vBox.addChild(radioButton2);
vBox.addChild(radioButton3);
vBox.addChild(radioButton4);
vBox.addChild(radioButton5);
addChild(vBox);
}
private function checkBox_change(evt:Event):void {
radioGroup.enabled = checkBox.selected;
}
]]>
</mx:Script>
</mx:Application>