Comunidad de diseño web y desarrollo en internet online

pop up en as3

Citar            
MensajeEscrito el 08 Jul 2009 11:25 pm
Cómo puedo abrir un Popup desde un botón de AS3?

Por cinlin

6 de clabLevel



 

firefox
Citar            
MensajeEscrito el 08 Jul 2009 11:44 pm
hay un tutorial exactamente de eso, revisa los ultimos tutos, es de hace unos dias

Por nazcaline

272 de clabLevel

3 tutoriales

Genero:Masculino  

firefox
Citar            
MensajeEscrito el 10 Jul 2009 06:36 pm
DE LA SIGUIENTE MANERA

Código :

private function iniciarDos():void
         {
            win=login(PopUpManager.createPopUp(this, login, true));
            win.x=135;
            win.y=165;

         }
      ]]>


en este caso login es una vista , luego utilzas el remove de la clase Manager para remover.SUERTE AMIGO

Por xcom

Claber

530 de clabLevel



 

firefox
Citar            
MensajeEscrito el 10 Jul 2009 06:41 pm
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

Por xcom

Claber

530 de clabLevel



 

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.