RadioButton Control in Flex


 

RadioButton Control in Flex

In the current tutorial you will come to know about the RadioButton control of Flex. The RadioButton control in Flex is a set of choices which are mutually exclusive. We can select any one option at a time. This control has number of RadioButtons which are clubbed as a single group. Only one member of this group can be selected at a time. We can not select more than one radio button at a time. The examples will help you to learn RadioButton more effectively

In the current tutorial you will come to know about the RadioButton control of Flex. The RadioButton control in Flex is a set of choices which are mutually exclusive. We can select any one option at a time. This control has number of RadioButtons which are clubbed as a single group. Only one member of this group can be selected at a time. We can not select more than one radio button at a time. The examples will help you to learn RadioButton more effectively

RadioButton Control in Flex:

The RadioButton control in Flex is a set of choices which are mutually exclusive. We can select any one option at a time. This control has number of RadioButtons which are clubbed as a single group. Only one member of this group can be selected at a time. We can not select more than one radio button at a time.

<mx:RadioButton> tag is used to access this control, we can put an id to this control if we need to access from any other tag in MXML file or in ActionScript file.

Radio Button Control in Flex Example:

<?xml version="1.0" encoding="utf-8"?>/p>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" >

<mx:Script>

<![CDATA[

import mx.controls.Alert;

public function display():void{

if(op1.selected==true){

Alert.show("Adobe");

}

if(op2.selected==true){

Alert.show("MicroSoft");

}

if(op3.selected==true){

Alert.show("Sun");

}

if(op4.selected==true){

Alert.show("Mozilla");

}

}

]]>

</mx:Script>

<mx:Panel title="RadioButton Example " horizontalCenter="10" verticalCenter="10" paddingBottom="10" paddingLeft="10" paddingRight="10" paddingTop="10">

<mx:Label text="Select any of the following RIA"/>

<mx:RadioButton groupName="ria" id="op1" label="Flex"/>

<mx:RadioButton groupName="ria" id="op2" label="SilverLight"/>

<mx:RadioButton groupName="ria" id="op3" label="JavaFx"/>

<mx:RadioButton groupName="ria" id="op4" label="XUL"/>

0

<mx:Button click="display()" label="Product of"/>

</mx:Panel>

</mx:Application>

1

 

OOutput:

Ads