0 Replies Latest reply on Sep 19, 2006 10:11 AM by Newsgroup_User

    Alert on top of Window component

    Level 7
      Hello my dear friends:

      I Ihav a Window COmponent which I programmatically created on stage.
      When I hit the close button I manage to close the Window component
      But I actually need to caLL an Alert box to let the user choose if he
      wishes to close the Window.

      I manage to call the Alert box but it appears behind the Window .
      Obviously I need it in front. Any help?

      This is my code:

      stop();
      import mx.managers.PopUpManager;
      import mx.containers.Window;

      import mx.controls.Alert;

      var mi_manejador = function (evta) {
      if (evta.detail == Alert.OK) {
      trace("La acción se ejecutó");
      } else {
      trace("La acción se canceló");
      }
      };

      Alert.okLabel = "Si";
      Alert.cancelLabel = "No";


      var miAlerta = Alert.show("¿Deseas abandonar la prueba?", "Alert",
      Alert.OK | Alert.CANCEL, null,
      mi_manejador, null, Alert.OK);


      var ventanaa:MovieClip = PopUpManager.createPopUp(this, Window, true,
      {contentPath:"preguntas",closeButton:true, title:"Prueba Corta 1"});
      ventanaa.setSize(550,350);
      ventanaa._x = 25;
      ventanaa._y = 25;


      var winListener:Object = new Object();
      winListener.click = function() {
      miAlerta();
      };
      ventanaa.addEventListener("click", winListener);



      THANKS!!