4 Replies Latest reply on Feb 22, 2011 4:55 AM by Ibarim

    alert over popup

    Ibarim Level 1

      Hi,

       

      I was wondering If there is any neat way to display alert over popups. Right now when I got popup on the screen and display alert the alert is under popup.

       

      Should I use the popup instance as parent of the alert?

        • 1. Re: alert over popup
          Bhavesh Sorathiya

          Hi,

          You can create alert popup after creationcomplete() of popup.

          • 2. Re: alert over popup
            Ibarim Level 1

            But the popup is already completed, I mean I didn't trace it's completition, but since it's on the stage it must be completed.

            • 3. Re: alert over popup
              BhaskerChari Level 4

              Hi Ibarim,

               

              Can you post the sample test case reproducing the problem...??

               

               

              Thanks,

              Bhasker

              • 4. Re: alert over popup
                Ibarim Level 1

                Hi Bhasker,

                 

                here it is:

                 

                1. I display popup:

                 

                myPopUp = PopUpManager.createPopUp(this,myPopUp,true,PopUpManagerChildList.POPUP) as myPopUp;
                myPopUp.setData(3,2);
                PopUpManager.centerPopUp(myPopUp);
                 

                2. PopUp is on the stage.

                 

                3. On user press Esc button I display alert:

                 

                if (e.keyCode == 27) {
                e.preventDefault();
                Alert.yesLabel = "Tak";
                Alert.noLabel = "Nie";     
                Alert.show("Do you want to finish?", "Finish",(Alert.YES|Alert.NO),this,isFinished);
                }

                 

                4. Above alert is displayed under the popUp.

                I tried:

                 

                var alrt:Alert = Alert.show("Do you want to finish?", "Finish",(Alert.YES|Alert.NO),this,isFinished);
                PopUpManager.bringToFront(alrt);
                

                 

                but it's not working. Just a minute ago I've done this by setting alert's parent as popUp. Like this:

                 

                 

                if (systemManager.popUpChildren.numChildren) Alert.show("Do you want to finish?", "Finish",(Alert.YES|Alert.NO),systemManager.popUpChildren.getChildAt(0) as Sprite,isFinished);
                else  Alert.show("Do you want to finish?", "Finish",(Alert.YES|Alert.NO),this,isFinished);

                 

                but I thought that there is some simpler way of displaying alert on top of popup.