flex学习笔记一

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundColor="#FFAAEE" borderColor="#FF0000" fontSize="14" borderStyle="solid">
<mx:Script>
 <![CDATA[
 import mx.events.ItemClickEvent;
 import mx.controls.Alert
 import flash.events.Event
 private function clickbtn(event:Event):void{
  message.text="您好,"+username.text;
  Alert.okLabel="确定";
  mx.controls.Alert.show("您的姓名:"+username.text+" 您的密码:"+password.text,"弹出对话框",Alert.OK);
 }

    private function showhobby(event:ItemClickEvent):void{
    message.text="您的爱好是:"+event.currentTarget.selectedValue;
    }
  
 ]]>
</mx:Script>
<mx:Panel title="我的控件" id="mypanel" width="620" height="532" x="10" y="10">
 <mx:Label text="姓名" /> <mx:TextInput id="username" name="username" paddingLeft="10" width="107"/>
 <mx:Label text="密码" /><mx:TextInput id="password" name="password" displayAsPassword="true" />
 <mx:RadioButtonGroup id="hobby" itemClick="showhobby(event)" />
 <mx:RadioButton id="volleyball" groupName="hobby" value="volleyball" label="排球" />   
 <mx:RadioButton id="football" groupName="hobby" value="football" label="足球" /> 
 <mx:TextArea id="message" paddingLeft="10" width="211" height="113" text="吃喝玩乐"/>
 <mx:Button label="小按钮"  click="clickbtn(event)" cornerRadius="10" />
</mx:Panel>
</mx:Application>
 

    A+
发布日期:2008年12月07日  所属分类:未分类

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: