How to close a pop-up window without closing the entire application?

Greetings!

I just want to ask for help with this case. Here, I have a screenshot of what I'm trying to accomplish:

screenshot.jpg

I used this code, but it turns out that it closes the whole application:

import flash.system.fscommand;
btn_exit.addEventListener (MouseEvent.CLICK, goExit);
function goExit(evt:MouseEvent) {}
fscommand ("QUIT");
}

should what code I use to accomplish my goal? Thanks in advance!

Sincerely,

Milo

1. don't you implement event handing in CongratsMC?

2. Yes, there is a conflict because congratulations to instance inside function is a quite different case: it is not seen outside the dropObject() method - therefore it can not be removed in the listener. So, you must do the following (read the comments in the case of top):

function dropObject(e:MouseEvent):void {
     stage.removeEventListener(MouseEvent.MOUSE_UP, dropObject);
     stopDrag();
     var droppedOn:MovieClip;
     correctCounter.text = String(correct);
     if (currentlyDragged.dropTarget) {
          // loop through targets belonging to the currently dragged clip
          for each(var mc:MovieClip in currentlyDragged.dropTargets) {
               if (currentlyDragged.hitTestObject(mc)) {
                    // get the target
                    droppedOn = mc;
                    currentlyDragged.removeEventListener(MouseEvent.MOUSE_DOWN, pickObject);
                    currentlyDragged.buttonMode = false;
                    currentlyDragged.x = droppedOn.x;
                    currentlyDragged.y = droppedOn.y;
                    correct++;
                    correctCounter.text = String(correct);
                    // stop loop - it is not necessary to continue
                    break;
               }
          }
     }
     attempt++;
     attemptCounter.text = String(attempt);
     // return to the initial position if there is no hit
     if (!droppedOn) {
        currentlyDragged.x = startX;
        currentlyDragged.y = startY;
     }
     // DO NOT DECLARE THIS VARIABLE AGAIN - YOU ALREADY HAVE THE INSTANCE
     //var congrats:CongratsMC;
     if (correct == objects.length) {
          // DO NOT INSTANTIATE IT
          //congrats = new CongratsMC();
          // place i in the middle of the screen
          congrats.x = (stage.stageWidth - congrats.width) * .5;
          congrats.y = (stage.stageHeight - congrats.height) * .5;
          addChild(congrats);
     }
}

Tags: Adobe Animate

Similar Questions

  • How can I implement a comfirmation window when closing the javafx applications?

    Hi, guys
    I would add a confirmation window when the user closes my javafx application, if the user clicks Yes, I close the application, so no, I wouldn't close it, how can I implement this feature?
     
    primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>(){
    
                   @Override
                   public void handle(WindowEvent arg0) {
                        try
                        {
                             //todo
                        }
                        catch(Exception ex)
                        {
                             System.out.print(ex.getMessage()+"\r\n");
                        }
    
                   }
            });

    Hello. Here is an example:

    import javafx.event.ActionEvent;
    import javafx.event.EventHandler;
    import javafx.geometry.Pos;
    import javafx.stage.*;
    import javafx.scene.*;
    import javafx.scene.paint.Color;
    import javafx.scene.layout.*;
    import javafx.scene.control.*;
    
    public class ModalDialog {
    
        public ModalDialog(final Stage stg) {
         final Stage stage = new Stage();
            //Initialize the Stage with type of modal
            stage.initModality(Modality.APPLICATION_MODAL);
            //Set the owner of the Stage
            stage.initOwner(stg);
            Group group =  new Group();
            HBox hb = new HBox();
             hb.setSpacing(20);
            hb.setAlignment(Pos.CENTER);
            Label label = new Label("You are about to close \n your application: ");
            Button no  = new Button("No");
    
            no.setOnAction(new EventHandler() {
    
                public void handle(ActionEvent event) {
                       stage.hide();
                }
            });
            Button yes  = new Button("Yes");
            yes.setOnAction(new EventHandler() {
    
                public void handle(ActionEvent event) {
                       stg.close();
                }
            });
    
             hb.getChildren().addAll(yes, no);
             VBox vb =  new VBox();
             vb.setSpacing(20);
             vb.setAlignment(Pos.CENTER);
             vb.getChildren().addAll(label,hb);
            stage.setTitle("Closing ...");
            stage.setScene(new Scene( vb, 260, 110, Color.LIGHTCYAN));
            stage.show();
    
        }
    
    }
    

    Test:

       import javafx.application.Application;
    import javafx.event.ActionEvent;
    import javafx.event.EventHandler;
    import javafx.scene.Group;
    import javafx.scene.Scene;
    import javafx.scene.control.Button;
    import javafx.scene.paint.Color;
    import javafx.stage.Stage;
    import javafx.stage.*;
    
    /**
     *
     * @author Shakir
     */
    public class ModalTest extends Application {
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            Application.launch(ModalTest.class, args);
        }
    
        @Override
        public void start(final Stage primaryStage) {
            primaryStage.setTitle("Hello World");
            Group root = new Group();
            Scene scene = new Scene(root, 300, 250, Color.LIGHTGREEN);
    
           primaryStage.setOnCloseRequest(new EventHandler(){
    
                   @Override
                   public void handle(WindowEvent arg0) {
                                    arg0.consume();
                        try
                        {
                         ModalDialog md = new ModalDialog(primaryStage);
                                    }
                        catch(Exception ex)
                        {
                             System.out.print(ex.getMessage()+"\r\n");
                        }
    
                   }
            });
    
            primaryStage.setScene(scene);
            primaryStage.show();
        }
    }
    
  • How to create a child window without closing the parent window

    Hi all

    I have a requirement to create a child window without closing the parent window. I have to click on an element in the parent window, then is expected to open a child window. The parent window must not be closed before you close the child window.

    Kindly help me in this.

    Thank you and best regards,

    Myvizhi

    Hi all

    I found the solution for this. I created a new page. Then I created an article in the style of link in the parent element, and I put the following properties in the link element:

    Destination URI: OA.jsp?page=/seagate/oracle/apps/seasoa/que/webui/SeaSoaHeaderDetailPG&headerId={@ErrHeaderId}&retainAM=Y&addBreadCrumb=Y&backPage=S

    Target framework: _blank

    This opens the new child window without closing the parent window.

    Thank you and best regards,

    Myvizhi

  • How to add a pop-up window to set the date and time in a field

    How to add a pop-up window to set the date and time in a field? I know how to add the date. I create the field time with JavaScript event initialize like this:

    this.rawValue = num2date(date(), DateFmt(4));
    

    What I should change the script and the motive to do it properly.

    I changed the Format of data (object > link tab) date time but nothing happen. I want to set up a pop-up window as for the setting of date but with addition of time setting.

    Is this possible? Or that the date fixed like that? Should I get hour hand?

    Hello

    I don't think you will get both in the calendar popup. Basically, the popup calendar is the default behavior. It may be possible to develop a custom component, but it would take a bit of scripting and would probably not be worth the effort.

    I'd get the user to time manually entry in a separate field.

    Good luck

    Niall

  • How come back initially on an editing session without closing the entire program and start again?

    How come back initially on an editing session without closing the entire program and start again?

    Hello

    There are two answers to this. If you have not saved the image since the opening, you can restore the file Menu-Revert or F12 and that will bring back you at the beginning. A more elegant solution is the historical Panel.

    Photoshop has a history panel (Windows Menu-history) that keeps track of everything you do on an image and allows you to go back in the flow of work and in effect then go ahead if you change your mind. The original image is always registered as a snapshot and then subsequent action recording. So you can come back not only the original image, but any previous change after opening. You can even take your own snapshots which is a useful feature.

    Hope that helps

    Terri

  • Adding a substitution string without exporting the entire application

    Hello

    I was wondering if it was possible to add a substitution string to an application on a different environment without having to export the entire application.

    I use export by component a lot, but now I have a small update a page and a substitution string (specified in the Application definition).

    I have to get this update to another copy of our application, without the substitution of the entire application.

    With a full export, I noticed that the wwv_flow_api.create_flow function is called that has a lot of parameters and substitution strings:

    p_substitution_string_18 = > 'TEST ',.

    p_substitution_value_18 = > ' < img src = "" & test.png "title ="test"/ >".

    There is another function that can add them separately? Or I can insert them with a statement on a table?

    Hope someone can shine some light on this case, so I know how to export more different components.

    Thank you


    Robert

    PS: I use apex 4.2 with 11g, but I don't think that what really matters on this case.

    The substitution variables are found in the wwv_flows table and run from 01-20, you have to identify you with the user/schema of APEX_040200...

    Select substitution_string_01, substitution_value_01 from wwv_flows where id = 101;

    Update wwv_flows set substitution_value_01 = 'new value' where id = 104;

    Kind regards

  • How to close a pop-up open running in the new thread in Teststand without manual intervention?

    Hello

    I'm keycycle in infinite while loop. There are two ways to break out of the loop

    1. click on the 'OK' button on the pop-up that says "complete the event. The pop up is running in a new thread.

    2 increase the value of the parameter "Reset_Count".

    If I choose the first way the sequence runs completely, but if I choose the second way then execution gets stuck in cleaning and waiting for me to click on the button 'OK' Popup.

    So my question is, is there any way by which I can close the popup without manual intervention?

    I have attached the seq, in case you want to see exactly what is happening.

    Thank you

    Hello.

    Yes, replace the TestStand popup a dialog box with custom of LabVIEW.  Here are my first thoughts on a simple method...

    a.) replace the TS popup with a LabVIEW dialog box.  The LabVIEW dialog box contains an OK button and a loop waiting for an LV notifier.  Simply wait for the notifier of LV (with a timeout of 100 ms) as well as the OK.button.

    Then when you get your external reset to end the test, create an another VI to SET the alert (with data as a Boolean value) system to stop the dialog box.

    Let me know if this can work.  I could put something togther for example, if any.

    Thank you
    PH

  • Pop-up window without refreshing the page

    Hello

    I want to display a pop-up window in my webpage (designed in php & MySQL), if I get a few values in my database .


    (Automatically, I want the pop-up window to display in the auto-refresh).


    Please help me.


    Thanks in advance.


    I've done it before "onload" with a box of "alert". If the database field is set to ONE gets skipped the alert box open using the box to light "fancybox:

    New update

    Stir then relax "anchor" page:

  • How do I make pop up windows back to the left side of the screen when they are moving to the right?

    Whenever I click on a link, a new window opens. That's good, that's what I wanted. They always opened up on the left side of the screen. However, they now open in the middle of the screen. It's already happened and the screen finally opened completely on the right. Last time this happened, I ended up having to remove something. I don't know what, but it solved the problem. Help, please!

    You can check the problems caused by a corrupt localstore.rdf file.

    You can also try to emove the plist of Firefox (org.mozilla.firefox.plist).

    Go to "~/Library/Preferences" and delete the plist for Firefox (org.mozilla.firefox.plist)

  • How can I display an error message on the listening port close popup without closing the popup.

    Hi Experts,

    JDeveloper 12.1.3.0.0

    How can I display an error message on the listening port close popup without closing the popup.

    Thank you

    Roy

    As its name suggests, close listener of popup is called when popup is closed so you can not do this.

    If you want to display the popup message, use your own buttons instead of the ok/cancel default buttons and close the popup programmatically.

    Dario

  • How to create centered pop-up window


    How do you get a pop up window appears in the center of a screen? I did in the past on go live using a form of action a 3rd party. I don't see any investment option on the pop-up windows behavior.

    THX

    Thank you very much

  • Close the last tab without closing the application firefox

    Greetings!

    1.i would like to close the last tab without closing the application. The behavior I expect is the application to open a new empty tab when I close the last tab currently I can't close the last tab which already has some open site in it.

    2. when I open a new tab, I have to enter a Web site address. I expect the app to just open a new empty tab and let him to enter an address or not for me.

    Thank you for your support. I love firefox for Android.

    It is being developed and will be changed to allow the closure of the last tab in Firefox 18 or 19.

  • How can I remove songs from playlist without deleting the library?

    I have the song in the playlist right click and you click on delete, then the song just completely deleted my iTunes library. But I want only to remove it from my reading list. How can I remove songs from playlist without deleting the library?

    Highlight the track, press the delete key. If it still removes the track completely from the library, then at some point in the past you must tell it to do things like that.   iTunes prefs > advanced > reset all warnings of the dialog box. - https://discussions.apple.com/message/23987276

  • How can I display an email address without opening the email?

    How can I display an email address without opening the email?  I want to know who sent me spam so I can block it without opening the email.

    There is no danger at the opening of the long spam email that you do not click on any links in the email.

  • How can I unlock my iPhone 4 without erasing the data? I know my password but its saying its wrong

    How can I unlock my iPhone 4 without erasing the data on it? I know what is my password, but it says its wrong. He lets me twice after continuous tent of the same password so I know it's the right password. There must be something wrong with the phone, but I don't know what.

    You cannot unlock the device without erasing it first (relocation of iOS).

Maybe you are looking for

  • El Capitan works very slowly

    OK so I upgraded my mac to Yosemite to el Capitan.The graphics are very slow. I'm having the turning wheel on opening any application. The boot is also slowed. System Preferences take a long time to open. Each task on my mac has been slowed. In the y

  • The dust under the glass

    Hello world! the has found several pieces of dust under my glass of ion - x in the lower left corner. Nobody knows: our limited warranty covers this issue? someone face thing? It's ok, or his problem with adhensive, which keeps the front glass?

  • Overheating my Atrix

    I don't really know how an Atrix must generate heat. But I want my own get hot, especially when I use it's hard. Heat is located right next to the MotoBlur logo. Any idea on the amount of heat is normal?

  • Z370 cannot detect any wifi network to all the

    Hi, my ideapad z370 suddenly stopped detecting any wifi network. I know this isn't my wifi router that has the problem because my ipad can connect to wifi. any help? Thank you very much!

  • HP 7520 printer all in one

    Help please! I have a printer that is connected wireless.  According to Apple Help (which I would say brightly surpasses anything HP support so far) there is no other application that could interfere with the wireless communication.  What should I do