现在的位置: 首页 > 综合 > 正文

如何使用Flex RadioButton

2018年05月01日 ⁄ 综合 ⁄ 共 1016字 ⁄ 字号 评论关闭
  1. <?xml version="1.0"?>  
  2. <!-- Simple example to demonstrate RadioButton control. -->  
  3. <!--   
  4.     如何使用Flex RadioButton   
  5.     MyShareBook.cn 翻译   
  6. -->  
  7. <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">  
  8.   
  9.     <mx:Script>  
  10.         import mx.controls.Alert;   
  11.     </mx:Script>  
  12.   
  13.     <mx:Panel title="RadioButton Control Example" height="75%" width="75%"    
  14.         paddingTop="10" paddingLeft="10" paddingRight="10">  
  15.   
  16.        <mx:Label width="100%" color="blue"  
  17.            text="What year were women first allowed to compete in the Boston Marathon?"/>  
  18.   
  19.         <mx:RadioButton groupName="year" id="option1" label="1942"/>  
  20.         <mx:RadioButton groupName="year" id="option2" label="1952"/>  
  21.         <mx:RadioButton groupName="year" id="option3" label="1962"/>  
  22.         <mx:RadioButton groupName="year" id="option4" label="1972"/>  
  23.   
  24.         <mx:Button label="Check Answer"    
  25.             click="Alert.show(option4.selected?'Correct Answer!':'Wrong Answer', 'Result')"/>  
  26.        
  27.     </mx:Panel>  
  28. </mx:Application>  

抱歉!评论已关闭.