Prevent the closing LoginDialog when entering a wrong password

How can I prevent the LoginDialog from closing when the user enters a bad password? I tried event.stopImmediatePropogation and event.stopPropogation ()... When the user clicks on the button "Login" dialog closes connection when I want to stay open and display its errorText = "Incorrect password"

private function login(password:String):void{
    var alert:LoginDialog = new LoginDialog();
    alert.title = "Login";
    alert.message = "Please enter your Password:";
    alert.passwordPrompt = "password";
    alert.addButton( 'Quit' );
    alert.addButton( 'Login' );
    alert.addEventListener(Event.SELECT, alertButtonClicked);
    alert.show(); 

    function alertButtonClicked( event : Event ) : void
    {
        switch (event.target.getItemAt(event.target.selectedIndex).label){

            case "Login":
                if (alert.password == password){
                    continueAfterLogin()
                }else{
                    alert.errorText = "Incorrect Password!"
                    // i tried both of these
                    event.stopImmediatePropagation();
                    event.stopPropagation();
                }
                break;
            case "Quit":
                stage.nativeWindow.close();
                break;

        }

    }
}

The only thing that seems to work: callLater (alert.show);

   case "Login":
    if (alert.password == password){
        continueAfterLogin()
    }else{
        alert.errorText = "Incorrect Password!"
        callLater(alert.show);
    }
    break;

Easy:

alert.cancelRequired = true;

This will keep the dialog box when you press a button and you will have to remove it when needed on the button event handler with:

Alert.Cancel ();

Tags: BlackBerry Developers

Similar Questions

  • Disable the background audio when entering the slide

    I put a check mark on stop the background sound to a slide. However, if a person continues forward and then return to the slide, the background sound plays. I want to have one on enter Action that will prevent this situation. Does anyone know if there is a way to stop the background sound in an action on enter?

    There are audio slide in the slide, so I won't stop completely all the sound elements, just the background sound when a person returns to the slide again.

    Publication corrects the problem. Thanks for your help.

  • I have a problem with the cursor jumps when entering text.

    Original title: cursor jumping when entering text

    I use Microsoft 7 and the cursor keeps jumping when I type. This causes the text to be misplaced. Some answers I've seen only direct you to the hardware options but never directly any specific solution. Grateful for ideas?

    Hey Joe,

    Thanks to join Microsoft Community where you will find all the required information on the Windows operating systems!

    The problem may occur due to the speed of the pointer mouse inappropriate or if the sensitivity of the touchpad is too high.

    To help you better, we need more information.

    What is brand and model computer?

    To work with the issue, I suggest you follow these steps:

    Method 1: Hardware store

     

    Open the hardware and devices Troubleshooter

    http://Windows.Microsoft.com/en-us/Windows7/open-the-hardware-and-devices-Troubleshooter

    Method 2: Update mouse drivers

     

    Updated a hardware driver that is not working properly

    http://Windows.Microsoft.com/en-us/Windows7/update-a-driver-for-hardware-that-isn ' t-work correctly

     

    Method 3:

     

    Change the settings of the mouse pointer.

     

     

    Refer to section to change the mouse pointer works on the site:

    Change the settings of the mouse

    http://Windows.Microsoft.com/en-in/Windows7/change-mouse-settings

    Method 4:

    If you use a laptop, change the sensitivity of the touchpad.

    See solving problems with your touchpad in more options in the site:

     

    Mouse, touchpad and keyboard with Windows problems

    http://Windows.Microsoft.com/en-in/Windows/help/Mouse-touchpad-and-keyboard-problems-in-Windows

     

    I hope this helps. If the problem persists, or if you have problems of Windows in the future, let us know and we would be happy to help you.

  • Can't the secure area.  At work, but now the Login Page crashes when enter name and password.

    Site built using Muse, then used Business Catalyst to implement the safe area.  Site has worked for several months, but the Login Page looked pretty little professional, since the area name and password may appear almost anywhere on the page.  Ask for help from Adobe and tech sent Adobe page 'Test' to check the presentation. Now Login Page does not work.  When to enter name and password and press return - nothing!  To 'Escape' off-page - it just hangs.  If members of the community site can share is no longer internal data.

    Would appreciate any help trying to solve this problem.

    Thank you!

    Please share the link to the page where the shape is placed, as well as the test user login information, so that we can still focus on this. Also a screenshot showing the issue you face would be a great help.

  • How to prevent the menu instance when click a button?

    Hi all

    My screen has added a button and I put in place for processing when the user clicks on this button.

    When I click on this button, my treatment of click event code has will work perfectly. But after the click, a menu always occur an inconvenience to the user. This menu contains the elements 'Application Switch' and «Full Menu»

    How to prevent this, thank you!

    use CONSUME_CLICK

    ButtonField sample = new ButtonField("Test",ButtonField.CONSUME_CLICK);
    
  • How can I prevent the launch Photos when I plug my SD card

    Whenever I plug in my SD card, Photos launches and interferes. How can I stop pictures to do this? I tried the preferences, but the option was not there.

    It's pretty simple, when you plug your sd card just to check the box that says "open photos for this device". It's in the section import the photos app.

    After that it should fix your problem.

  • How to prevent the WIndows Activation when you restore the material in the same FVO

    I just want to know, on a Vmware ESX 3i 3.5.0 on a hard disk crash scenario, when only the hard drive has been replaced.   How yo make an ovf import (backup) that requires no windows activation.

    Please see my answer to your previous question (Re: still Windows Activation required even if the restore of a virtual server on the same hardware)

    André

  • Is it possible to prevent the device restarts when I deploy an application?

    Hello

    Whenever I have deploy an application on my device (Blackberry 9780, OS6.0) to test the device restarts. Is it possible to deploy without having to go through this lengthy process?

    Who knows what is happening behind the scenes!

    There are simple things, like the establishment of the correct size at startup icon, which will mean that your device needs to restart after the installation.

    Since I believe PhoneGap and WebWorks are about you, you can get an answer on the forum WebWorks.

    http://supportforums.BlackBerry.com/T5/Web-and-WebWorks-development/BD-p/browser_dev

  • Vista invites the login screen to enter username and password for folder during the connection

    Hi all
    I have the shared folder on XP. A few days ago I changed the password on the XP machine for the user of Vista, and now I can't connect to the shared folder, because Vista is by using the old password and didn't invite the login user name and password window. Then I try to connect from another PC with Windows7, everything goes well. Even when I change the password on PC XP Windows7 user (just quick Windows7 home screen of the user name and password, so I can enter the same username and the new password to connect successfully). Please, help me to deal with this question, suggestions or something?

    Sirdele

    Try clicking on this link below, it should help you with your problem.

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-networking/Windows-7-asks-enter-network-password-when/2a8e6d6f-74a1-43C7-8530-24e8522ea955

  • trace the IP / user login database with wrong password machine

    Hi all
    I would like to find information of machine or IP address of the user who is trying to connect to the database with incorrect password.

    I'm on 11g. Please can I know whether it is possible to obtain this information and if yes then how to configure.

    Thank you.

    1 enable auditing of database with pararameter AUDIT_TRAIL

    SQL> show parameter audit_trail;
    
    NAME                                 TYPE        VALUE
    ------------------------------------ ----------- ------------------------------
    audit_trail                          string      DB_EXTENDED
    

    2 enable auditing of the session

    SQL> audit session;
    
    Audit succeeded.
    

    3. check the DBA_AUDIT_TRAIL view:

    SQL> select os_username, userhost, username, action_name, timestamp, returncode
      2  from dba_audit_trail
      3  where returncode=1017;
    
    OS_USERNAME
    --------------------------------------------------------------------------------
    USERHOST
    --------------------------------------------------------------------------------
    USERNAME                       ACTION_NAME                  TIMESTAMP RETURNCODE
    ------------------------------ ---------------------------- --------- ----------
    pierre
    WORKGROUP\PC-de-pierre
    HR                             LOGON                        22-FEB-11       1017
    

    1017 means Oracle ORA-1017 error:

    oerr ora 1017
    01017, 00000, "invalid username/password; logon denied"
    // *Cause:
    // *Action:
    

    OS_USERNAME is the name of the user account that is trying to connect to Oracle BONES
    USERHOST is the name of the computer where the executable tried to connect.

    Edited by: P. Forstmann on 22 Feb. 2011 13:39

    Edited by: P. Forstmann on 22 Feb. 2011 13:41

  • When closing my one computer program "" ITIBITI /. ". EXE"appears on the screen prevents the computer shutdown.

    Original title: when closing my computer a program "" ITIBITI /. ". EXE"appears on the screen prevents the closing... the computer needed to force the point to close before I can close the computer

    I don't know how to describe it better but will try.

    When I select 'close the computer' page is in place ('close').  At the same time, a program called "' I T I B I T E X IE" appears on the screen. "

    Receive the note that says 'close', but she will close by have by clicking on "close".  I have to force it closed before I can close the computer.

    I hope it's understanable.

    Hey AvisTilly,

    Unless you have installed a program called ITIBITI, it would be a good idea to scan your computer for malware. Run a full scan using the Scanner below the link Microsoft to see if he can identify or remove malicious programs from your system.
    Microsoft safety scanner

    Hope that helps.

  • BlackBerry smartphone how to stop the charge battery when it is connected to the PC?

    Hi guys, anyone know how to prevent the battery charge when the BlackBerry device is connected to the desktop via USB Manager? TKS!

    boldberries wrote:

    and I heard that it is bad recharge the battery when it is completely full.

    No good info. It is always good to overflow of a charge.

    Here's some good advice from loading, please read and you will see that many of them will be applicable to you.
    http://www.blackberrynews.com/2008/05/20/battery-use-tips-for-your-maximum-battery-life/

  • Why don't I have the closed captioning option on my menu?

    I'm trying to add a simple caption to a family film, but I don't have the ability to create a new closed caption.

    Untitled-1.jpgUntitled 2.jpg

    My current version of first is listed as 6.0.5

    Hi HornFlake76,

    First pro CS 6 option gives you only one option to see a preview of the closed caption when you activate it.

    You can download the trial version of first pro CC and add closed captioning and export it on

    as a quicktime file (it embedds closed captioning). Then, you can import this file into 6 Premiere pro CS

    and preview the subtitles encoded in the program monitor.

    Thank you

  • Why should my laptop enter me my password after having been inactive for awhile? How do I disable this feature?

    After 10-15 minutes of no activity, the mobile wants re-enter me my password until I can do all the work on it.

    It is a function to prevent someone from coming to your computer while you are temporarily away from him and have access to your data.

    It can be disabled.

    Right-click on the desktop and select Personalize.

    And in the lower right of the window, select the screen saver

    Uncheck the box on the resume, the logon screen.

    Click OK

  • I use to manage my DSL modem via an ip address. When I enter FF8 I wonder where to save the file. Why and how can I prevent the FF8 to do this?

    I use to manage my DSL modem via an ip address. When I enter FF8 I wonder where to save the file. Why and how can I prevent the FF8 to do this?

    And now, whenever I'm in an ip address that I wonder if I want to download the file.

    This happens when the modem server does not send the file in text/html, but with a different MIME type.

    I tried adding index.html in the event that the server can send this file as text/html.

    If your DSL modem has a support Web site, then you can try asking it there advice on how to configure the server modem.

Maybe you are looking for