| 패키지 | spark.components | 
| 클래스 | public class RadioButtonGroup | 
| 상속 | RadioButtonGroup    EventDispatcher   Object | 
| 구현 | IMXMLObject | 
| 언어 버전: | ActionScript 3.0 | 
| 제품 버전: | Flex 4 | 
| 런타임 버전: | Flash Player 10, AIR 1.5 | 
id property is required when you use the
  <s:RadioButtonGroup> tag to define the group name.  Any
  <s:RadioButton> component added to this group will 
  have this group name.
 
  Notice that the RadioButtonGroup component is a subclass of EventDispatcher,
  not UIComponent, and implements the IMXMLObject interface.
  All other Flex visual components implement the IVisualElement interface.
  The RadioButtonGroup component declaration must
  be contained within the <Declarations> tag since it is
  not assignable to IVisualElement.
To use this component in a list-based component, such as a List or DataGrid, create an item renderer. For information about creating an item renderer, see Custom Spark item renderers.
MXML 구문
MXML 구문 숨기기The <s:RadioButtonGroup> tag inherits all of the
  tag attributes of its superclass, and adds the following tag attributes:
  <s:RadioButtonGroup
    Properties
    enabled="true"
    selectedValue="null"
    selection="null"
 
    Events
    change="No default"
    itemClick="No default"
    valueCommit="No default"
  />
  
 
  기타 예제
관련 API 요소
| 속성 | 정의 주체 | ||
|---|---|---|---|
![]()  | constructor : Object 
	 지정된 객체 인스턴스의 클래스 객체 또는 생성자 함수에 대한 참조입니다.  | Object | |
| enabled : Boolean 
      Determines whether selection is allowed.  | RadioButtonGroup | ||
| numRadioButtons : int [읽기 전용] 
      The number of RadioButtons that belong to this RadioButtonGroup.  | RadioButtonGroup | ||
| selectedValue : Object 
      The value property of the selected
      RadioButton component in the group, if it has been set,
      otherwise, the label property of the selected RadioButton.  | RadioButtonGroup | ||
| selection : RadioButton 
      Contains a reference to the currently selected
      RadioButton component in the group.  | RadioButtonGroup | ||
| 메서드 | 정의 주체 | ||
|---|---|---|---|
RadioButtonGroup(document:IFlexDisplayObject = null) 
      Constructor.  | RadioButtonGroup | ||
![]()  | addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void 
	리스너에서 이벤트 알림을 받을 수 있도록 EventDispatcher 객체에 이벤트 리스너 객체를 등록합니다.  | EventDispatcher | |
![]()  | 
	이벤트를 이벤트 흐름으로 전달합니다.  | EventDispatcher | |
      Returns the RadioButton component at the specified index.  | RadioButtonGroup | ||
![]()  | 
	EventDispatcher 객체에 특정 유형의 이벤트에 대한 리스너가 등록되어 있는지 여부를 확인합니다.  | EventDispatcher | |
![]()  | 
	 지정된 속성이 객체에 정의되어 있는지 여부를 나타냅니다.  | Object | |
      Implementation of the IMXMLObject.initialized() method
      to support deferred instantiation.  | RadioButtonGroup | ||
![]()  | 
	 Object 클래스의 인스턴스가 매개 변수로 지정된 객체의 프로토타입 체인에 있는지 여부를 나타냅니다.  | Object | |
![]()  | 
	 지정된 속성이 존재하고 열거 가능한지 여부를 나타냅니다.  | Object | |
![]()  | 
	EventDispatcher 객체에서 리스너를 제거합니다.  | EventDispatcher | |
![]()  | 
     루프 작업에서 동적 속성을 사용할 수 있는지 여부를 설정합니다.  | Object | |
![]()  | 
	 로캘별 규칙에 따라 서식이 지정된 이 객체의 문자열 표현을 반환합니다.  | Object | |
![]()  | 
	 지정된 객체의 문자열 표현을 반환합니다.  | Object | |
![]()  | 
	 지정된 객체의 프리미티브 값을 반환합니다.  | Object | |
![]()  | 
	이 EventDispatcher 객체 또는 조상 객체에 지정한 이벤트 유형에 대한 이벤트 리스너가 등록되어 있는지 여부를 확인합니다.  | EventDispatcher | |
| 이벤트 | 요약 | 정의 주체 | ||
|---|---|---|---|---|
![]()  | [브로드캐스트 이벤트] Flash Player 또는 AIR 응용 프로그램이 운영 체제 포커스를 얻어 활성화될 때 전달됩니다. | EventDispatcher | ||
| Dispatched when the value of the selected RadioButton component in this group changes. | RadioButtonGroup | |||
![]()  | [브로드캐스트 이벤트] Flash Player 또는 AIR 응용 프로그램이 운영 체제 포커스를 잃고 비활성화될 때 전달됩니다. | EventDispatcher | ||
| Dispatched when a user selects a RadioButton component in the group. | RadioButtonGroup | |||
| Dispatched when values are changed programmatically or by user interaction. | RadioButtonGroup | |||
enabled | 속성 | 
enabled:Boolean| 언어 버전: | ActionScript 3.0 | 
| 제품 버전: | Flex 4 | 
| 런타임 버전: | Flash Player 10, AIR 1.5 | 
      Determines whether selection is allowed.  Note that the value returned
      only reflects the value that was explicitly set on the 
      RadioButtonGroup and does not reflect any values explicitly
      set on the individual RadioButtons. 
     
      
 기본값: true.
구현
    public function get enabled():Boolean    public function set enabled(value:Boolean):voidnumRadioButtons | 속성 | 
selectedValue | 속성 | 
selectedValue:Object| 언어 버전: | ActionScript 3.0 | 
| 제품 버전: | Flex 4 | 
| 런타임 버전: | Flash Player 10, AIR 1.5 | 
      The value property of the selected
      RadioButton component in the group, if it has been set,
      otherwise, the label property of the selected RadioButton.
      If no RadioButton is selected, this property is null.
     
      
If you set selectedValue, Flex selects the
      first RadioButton component whose value or
      label property matches this value.
 기본값: null.
이 속성은 데이터 바인딩에 대한 소스로 사용할 수 있습니다. 이 속성을 수정하면  valueCommit  이벤트를 전달합니다.
구현
    public function get selectedValue():Object    public function set selectedValue(value:Object):voidselection | 속성 | 
selection:RadioButton| 언어 버전: | ActionScript 3.0 | 
| 제품 버전: | Flex 4 | 
| 런타임 버전: | Flash Player 10, AIR 1.5 | 
      Contains a reference to the currently selected
      RadioButton component in the group.
      You can access this property in ActionScript only;
      it is not settable in MXML.
      Setting this property to null deselects the currently
      selected RadioButton component.  A change event is not dispatched.
     
      
 기본값: null.
이 속성은 데이터 바인딩에 대한 소스로 사용할 수 있습니다. 이 속성을 수정하면  valueCommit  이벤트를 전달합니다.
구현
    public function get selection():RadioButton    public function set selection(value:RadioButton):voidRadioButtonGroup | () | 생성자 | 
public function RadioButtonGroup(document:IFlexDisplayObject = null)| 언어 버전: | ActionScript 3.0 | 
| 제품 버전: | Flex 4 | 
| 런타임 버전: | Flash Player 10, AIR 1.5 | 
Constructor.
매개 변수document:IFlexDisplayObject (default = null) — In simple cases where a class extends EventDispatcher,
      the document parameter should not be used.
     
       | 
관련 API 요소
getRadioButtonAt | () | 메서드 | 
 public function getRadioButtonAt(index:int):RadioButton| 언어 버전: | ActionScript 3.0 | 
| 제품 버전: | Flex 4 | 
| 런타임 버전: | Flash Player 10, AIR 1.5 | 
Returns the RadioButton component at the specified index.
매개 변수
index:int — The 0-based index of the RadioButton in the
      RadioButtonGroup.
     
       | 
RadioButton — The specified RadioButton component if index is between
      0 and numRadioButtons - 1.  Returns
      null if the index is invalid.
     
       | 
관련 API 요소
initialized | () | 메서드 | 
 public function initialized(document:Object, id:String):void| 언어 버전: | ActionScript 3.0 | 
| 제품 버전: | Flex 4 | 
| 런타임 버전: | Flash Player 10, AIR 1.5 | 
      Implementation of the IMXMLObject.initialized() method
      to support deferred instantiation.
     
      
매개 변수
document:Object — The MXML document that created this object.
     
       | |
id:String — The identifier used by document to refer to this object.
      If the object is a deep property on document, id is null.
     
       | 
관련 API 요소
change | 이벤트 | 
flash.events.Event속성 Event.type =
flash.events.Event.CHANGE| 언어 버전: | ActionScript 3.0 | 
| 제품 버전: | Flex 4 | 
| 런타임 버전: | Flash Player 10, AIR 1.5 | 
Dispatched when the value of the selected RadioButton component in this group changes.
Event.CHANGE 상수는 change 이벤트 객체의 type 속성 값을 정의합니다. 
	
	이 이벤트에는 다음과 같은 속성이 있습니다.
| 속성 | 값 | 
|---|---|
bubbles | true | 
cancelable | false. 취소할 기본 비헤이비어가 없습니다. | 
currentTarget | 이벤트 리스너를 통해 Event 객체를 처리하고 있는 객체입니다. | 
target | 값이 수정된 객체입니다. target은 표시 목록에서 이벤트 리스너를 등록한 객체가 아닐 수도 있습니다. 표시 목록에서 현재 이벤트를 처리 중인 객체에 액세스하려면 currentTarget 속성을 사용합니다. | 
itemClick | 이벤트 | 
mx.events.ItemClickEvent속성 ItemClickEvent.type =
mx.events.ItemClickEvent.ITEM_CLICK| 언어 버전: | ActionScript 3.0 | 
| 제품 버전: | Flex 4 | 
| 런타임 버전: | Flash Player 10, AIR 1.5 | 
Dispatched when a user selects a RadioButton component in the group. You can also set a handler for individual RadioButton components. This event is dispatched only when the user interacts with the radio buttons by using the mouse.
TheItemClickEvent.ITEM_CLICK constant defines the value of the 
	  type property of the event object for an itemClick event.
	 
	  The properties of the event object have the following values:
| Property | Value | 
|---|---|
bubbles | false | 
cancelable | false | 
currentTarget | The Object that defines the 
           event listener that handles the event. For example, if you use 
           myButton.addEventListener() to register an event listener, 
           myButton is the value of the currentTarget.  | 
index | The index of the navigation item that was clicked. | 
item | The item in the data provider of the navigation item that was clicked. | 
label | The label of the navigation item that was clicked. | 
relatedObject | The child object that generated the event. | 
target | The Object that dispatched the event; 
           it is not always the Object listening for the event. 
           Use the currentTarget property to always access the 
           Object listening for the event. | 
valueCommit | 이벤트 | 
mx.events.FlexEvent속성 FlexEvent.type =
mx.events.FlexEvent.VALUE_COMMIT| 언어 버전: | ActionScript 3.0 | 
| 제품 버전: | Flex 4 | 
| 런타임 버전: | Flash Player 10, AIR 1.5 | 
Dispatched when values are changed programmatically or by user interaction.
Because a programmatic change triggers this event, make sure
  that any valueCommit event handler does not change
  a value that causes another valueCommit event.
  For example, do not change theselectedValue
  property or selection property in a valueCommit 
  event handler. 
FlexEvent.VALUE_COMMIT constant defines the value of the
      type property of the event object for a valueCommit
      event.
     
      The properties of the event object have the following values:
| Property | Value | 
|---|---|
bubbles | false | 
cancelable | false | 
currentTarget | The Object that defines the
           event listener that handles the event. For example, if you use
           myButton.addEventListener() to register an event listener,
           myButton is the value of the currentTarget.  | 
target | The Object that dispatched the event;
           it is not always the Object listening for the event.
           Use the currentTarget property to always access the
           Object listening for the event. | 
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark" 
               xmlns:mx="library://ns.adobe.com/flex/mx">
    <fx:Script>
        <![CDATA[   
            
            import mx.controls.Alert;
            import mx.events.ItemClickEvent;
            
            private function handlePayment(event:ItemClickEvent):void {
                if (event.currentTarget.selectedValue == "check") {
                    Alert.show("You opted to pay by check."); 
                } else if (event.currentTarget.selectedValue == "credit") {
                    Alert.show("You opted to pay by credit card.");
                }
            }
        ]]>
    </fx:Script>
    
    <fx:Declarations>
        <s:RadioButtonGroup id="paymentType" itemClick="handlePayment(event);"/>
    </fx:Declarations>
    <s:VGroup paddingLeft="10" paddingTop="10">
        <s:RadioButton groupName="paymentType" 
                       id="payCheck" 
                       value="check" 
                       label="Pay by check" 
                       width="150"/>
        <s:RadioButton groupName="paymentType" 
                       id="payCredit" 
                       value="credit" 
                       label="Pay by credit card" 
                       width="150"/>
    </s:VGroup>
</s:Application>
Tue Jun 12 2018, 03:17 PM Z
 
MXML 구문 표시