OTRO EJEMPLLO
Código :
?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="top"
horizontalAlign="center" backgroundGradientColors="[0x000000,0x323232]" paddingTop="20" viewSourceURL="srcview/index.html">
<mx:Script>
<![CDATA[
import mx.managers.PopUpManager;
import mx.containers.TitleWindow;
import flash.geom.Point;
private var point1:Point = new Point();
// Open the TitleWindow container.
// Cast the return value of the createPopUp() method
// to SimpleTitleWindowExample, the name of the
// component containing the TitleWindow container.
private function showWindow():void {
var login:SimpleTitleWindowExample=SimpleTitleWindowExample(PopUpManager.createPopUp( this, SimpleTitleWindowExample , true));
// Calculate position of TitleWindow in Application's coordinates.
point1.x=myButton.x;
point1.y=myButton.y;
point1=myButton.localToGlobal(point1);
login.x=point1.x+25;
login.y=point1.y+25;
// Pass a reference to the TextInput control
// to the TitleWindow container so that the
// TitleWindow container can return data to the main application.
login.loginName=returnedName;
}
]]>
</mx:Script>
<mx:Panel title="TitleWindow Container" layout="vertical" color="0xffffff" borderAlpha="0.15"
paddingTop="10" paddingRight="10" paddingBottom="10" paddingLeft="10" horizontalAlign="center">
<mx:Button id="myButton" color="0x323232" height="32" label="Click to open the TitleWindow container"
click="showWindow();"/>
<mx:Text id="returnedName" width="100%" color="0x323232" text="Waiting..."/>
</mx:Panel>
</mx:Application>
Y PARA EL LOGIN
[code]
?xml version="1.0" encoding="utf-8"?>
<!-- Simple custom MXML TitleWindow component.
The TitleWindowApp application displays this component.
You cannot run it independently. -->
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"
title="Title Window" x="168" y="86" status="active" showCloseButton="true" close="PopUpManager.removePopUp(this);" borderAlpha="0.75">
<mx:Script>
<![CDATA[
import mx.managers.PopUpManager;
import mx.controls.Text;
// A reference to the TextInput control in which to put the result.
public var loginName:Text;
// Event handler for the OK button.
private function returnName():void {
loginName.text="Name entered: " + userName.text;
PopUpManager.removePopUp(this);
}
]]>
</mx:Script>
<mx:HBox>
<mx:Label text="Enter Name: "/>
<mx:TextInput id="userName" width="100%"/>
</mx:HBox>
<mx:HBox>
<mx:Button label="OK" click="returnName();"/>
<mx:Button label="Cancel" click="PopUpManager.removePopUp(this);"/>
</mx:HBox>
</mx:TitleWindow>
[code]
espero que te seriva