<?xml version="1.0" encoding="utf-8"?> <mx:TitleWindow x="0" y="0" xmlns:mx="http://www.adobe.com/2006/mxml" width="304" height="178" layout="absolute" borderColor="#0000ff" title="Login"> <mx:Script> <![CDATA[ import mx.managers.PopUpManager; import mx.core.Application; import mx.controls.Alert; private function setCredentials():void { if( username.text.length == 0 || password.text.length == 0 ) { Alert.show( "Both username and password are required", "Incomplete Form" ); return; } Application.application.setCredentials( username.text, password.text ); PopUpManager.removePopUp( this ); } ]]> </mx:Script> <mx:Text x="18" y="29" text="Username:"/> <mx:Text x="24" y="70" text="Password:"/> <mx:TextInput x="93" y="27" id="username" text="testuser"/> <mx:TextInput x="93" y="68" id="password" displayAsPassword="true" text="password"/> <mx:Text x="93" y="13" text="hint: username is testuser" fontSize="9"/> <mx:Text x="93" y="53" text="hint: password is password" fontSize="9"/> <mx:Button x="109" y="106" label="Login" click="setCredentials()"/> </mx:TitleWindow>