Apache flex Flex:在CodeBehind中设置RadioButton的选定值

Apache flex Flex:在CodeBehind中设置RadioButton的选定值,apache-flex,radio-button,Apache Flex,Radio Button,我知道如何在Mxml中的单选按钮中选择默认值,如下所示: <ada:AdaRadioButton id="rbDDAACampNo" selected="{Dto==null || Dto.field!='Y' || Dto.field==null}" 您可以在AS中执行以下操作: //this is the handler of the creation complete of the component. onCreationComplete(e:FlexEvent):

我知道如何在Mxml中的单选按钮中选择默认值,如下所示:

<ada:AdaRadioButton id="rbDDAACampNo" 

    selected="{Dto==null || Dto.field!='Y' || Dto.field==null}" 

您可以在AS中执行以下操作:

//this is the handler of the creation complete of the component.
onCreationComplete(e:FlexEvent):void{
    rbDDAACampNo.selected = Dto==null || Dto.field!='Y' || Dto.field==null;
}

你说的“代码隐藏”是什么意思?您是否希望在
块中而不是在mxml中编写代码?@Brian代码隐藏是通常用于WPF的Microsoft word。如果有一个AS3类用作MXML的基础,那么该类就是“CodeBehind”。不过,它的工作原理与使用脚本标记相同。@Drahcir您的意思是像继承树中的父类一样?@Brian yes,其中子类是MXML文档。这个词来自WPF,在WPF中,视图被自动拆分为一个XAML文件和一个C#文件。