<?xmlversion="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"?minWidth="955"?minHeight="600">
????
????<fx:Script>
???????<![CDATA[
???????????import?com.flex.ases.LoginEvent;
???????????import?com.flex.ases.LoginMess;
???????????import?com.flex.module.LoginModule;
???????????
???????????import?mx.controls.Alert;
???????????import?mx.managers.PopUpManager;
???????????import?mx.rpc.events.FaultEvent;
???????????import?mx.rpc.events.ResultEvent;
???????????privatevar?loginModule:LoginModule=new?LoginModule();
???????????[Bindable]
???????????private?var?username:String;
???????????[Bindable]
???????????private?varpassworld:String;
???????????protectedfunction?login_clickHandler(event:MouseEvent):void
???????????{
??????????????//?TODOAuto-generated?method?stub
???????????????PopUpManager.addPopUp(loginModule,this,true);
???????????????PopUpManager.centerPopUp(this.loginModule);
???????????????loginModule.addEventListener(LoginEvent.LOGIN_EVENT,loginHander);
???????????}
???????????publicfunction?loginHander(event:LoginEvent):void{
??????????????//varobj:Object=event.loginMess?as?Object;
??????????????username=event.loginMess['username'];
??????????????passworld=event.loginMess['passworld'];
??????????????httpServiceSend.send();
???????????}
???????????
???????????protectedfunction?httpServiceSend_faultHandler(event:FaultEvent):void
???????????{
??????????????//?TODOAuto-generated?method?stub
??????????????Alert.show(event.fault.message?as?String,"提示");
??????????????
???????????}
???????????
???????????protectedfunction?httpServiceSend_resultHandler(event:ResultEvent):void
???????????{
??????????????//?TODOAuto-generated?method?stub
??????????????var?result:Boolean=event.result?as?Boolean;
??????????????if(result==true){
??????????????????Alert.show(username+",欢迎您回来!","提示");
??????????????????aaa.text=username+",欢迎您回来!";
??????????????????login.label="";
??????????????????bbb.text="";
??????????????????
??????????????}else{
??????????????????Alert.show("对不起,用户名或密码不存在!","提示");
??????????????}
??????????????//Alert.show("成功了!");
???????????}
???????????
???????]]>
????</fx:Script>
????
????<fx:Declarations>
???????<!--?Place?non-visualelements?(e.g.,?services,?value?objects)?here?-->
???????<s:HTTPService?id="httpServiceSend"??url="
http://localhost:8000/JavaAndFlexDemo/LoginServlet"?useProxy="false"fault="httpServiceSend_faultHandler(event)"result="httpServiceSend_resultHandler(event)"?>
???????????<s:request>
??????????????<username>{username}</username>
??????????????<passworld>{passworld}</passworld>
???????????</s:request>
???????</s:HTTPService>
????</fx:Declarations>
????<s:Label?x="200"?y="150"?width="182"?height="27"?fontSize="18"?id="aaa"?text="您还没有登陆,现在就"?verticalAlign="middle"/>
????<mx:LinkButton?x="393"??y="150"?width="57"??height="27"?label="登陆"?id="login"?fontSize="18"click="login_clickHandler(event)"/>
????<s:Label?x="459"?y="150"?width="37"?height="27"?id="bbb"?fontSize="18"?text="吧!"?verticalAlign="middle"/>
</s:Application>