登陆页面
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" >
<mx:Script>
<![CDATA[
import mx.messaging.messages.HTTPRequestMessage;
import mx.rpc.http.HTTPService;
import mx.controls.Alert;
private function loginuser():void{
if(txtuse.text == "admin" && txtpsw.text == "admin"){
var u:URLRequest = new URLRequest("http://www.busycode.com/Hellos.swf?UserName="+txtuse.text+"&&Password="+txtpsw.text);
u.method = "GET";
navigateToURL(u,"_parent");
}
}
]]>
</mx:Script>
<mx:Label x="243" y="162" text="username"/>
<mx:Label x="243" y="205" text="password"/>
<mx:TextInput x="313" y="160" id="txtuse"/>
<mx:TextInput x="313" y="203" id="txtpsw" displayAsPassword="true"/>
<mx:Button x="348" y="338" label="Login" click="loginuser()"/>
</mx:Application>
主页面 (必须要上传到服务器)
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="getUserName()">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
private function getUserName():void{
var username: String = "UserName";
var password:String = "Password";
lblUsername.text = this.parameters[username];
lblpassword.text = this.parameters[password];
}
]]>
</mx:Script>
<mx:Label x="183" y="206" text="UserName" width="106" id="lblUser" />
<mx:Label x="330" y="206" text="Label" width="84" id="lblUsername"/>
<mx:Label x="183" y="283" text="Passwrod" width="70"/>
<mx:Label x="330" y="283" text="Label" id="lblpassword"/>
</mx:Application>