특별한딸기이야기

radio 버튼 사용예 본문

딸기 공부방/flex

radio 버튼 사용예

특별한녀석 2008. 12. 26. 11:48
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
 <mx:Script>
  <![CDATA[
   import mx.controls.Alert;
   
   private function select() : void
   {
    // radio button select
    if(radioFruitApple.selected == true)
    {
     Alert.show("사과를 선택하셨습니다.");
    }
    
    if(radioFruitPear.selected == true)
    {
     Alert.show("배를 선택하셨습니다.");
    }
    
    if(radioFruitBanana.selected == true)
    {
     Alert.show("바나나를 선택하셨습니다.");
    }
    
    if(radioFruitJadoo.selected == true)
    {
     Alert.show("자두를 선택하셨습니다.");
    }
   }
  ]]>
 </mx:Script>
 <mx:RadioButton x="127" y="61" label="사과" id="radioFruitApple" fontSize="16" selected="true" groupName="fruit" />
 <mx:RadioButton x="127" y="87" label="배" id="radioFruitPear" fontSize="16" groupName="fruit" />
 <mx:RadioButton x="127" y="113" label="바나나" id="radioFruitBanana" fontSize="16" groupName="fruit" />
 <mx:RadioButton x="127" y="139" label="자두" id="radioFruitJadoo" fontSize="16" groupName="fruit" />
 <mx:Button x="154" y="177" label="선택하세요!" id="choiceButton" fontSize="16" click="select()" />
</mx:Application>

'딸기 공부방 > flex' 카테고리의 다른 글

text와 label  (1) 2008.12.26
image  (1) 2008.12.26
textarea 사용예  (1) 2008.12.26
check box 사용예  (0) 2008.12.26
로컬 스타일 정의하기  (0) 2008.12.08