Prevent Enter key from proceeding movie

I am using this code to get the user to enter the answer 16
in an input text field. It works but if the user hits the enterkey
after they've gotten the question right, the playhead starts and
moves to incorrect. This is not happening only in the testing
environment, the published file continues when Enter is pressed.
Can anyone help?
keyListener = new Object();
keyListener.onKeyUp = function() {
if (input_txt2.text == "16" and Key.getCode() == 13) {
//13 is key code for 'Enter'//
gotoAndPlay("1_3_13a");
_root.answer1 = "Correct!";
} else if (input_txt2.text != "16" and Key.getCode() == 13)
//13 is key code for 'Enter'//
_root.answer1 = "Incorrect.";
gotoAndPlay("1_3_13b");
Key.addListener(keyListener);

I'm not following what "…activated when the enter key
is pressed even after the event has occurred." means. You mean that
even after this first entry you press enter and the value of
input_txt2.text != "16" so it is jumping to 1_3_13B?
I think I know what you mean, maybe. Notice how you are
setting up a listener? Well it keeps listening, it isn't a one time
deal. It listens for a keyUp until you tell it to stop. So just
because it works once why would you expect it to stop working? :)
What you need to do is either inside your conditionals or
perhaps just inside the onKeyUp function put a
Key.removeListener(keyListener); to tell it to stop listening. If
you are doing some kind of remediation at 1_3_13b and then want
them to have another try, perhaps you will want to leave the
listener or you might want to remove it and then add it back. I
don't know the exact structure of what you are doing, but I hope
this points you in the correct direction.

Similar Messages

  • Preventing enter key from submission-- javaScript

    Hi,
    I am using the following code for preventing enter button from submission
    It is not working for other explorer's like AOL,FIREFOX,NETSCAPE
    onkeydown="if ((event.which && event.which == 13) ||
    (event.keyCode && event.keyCode == 13))
    {document.FormName.ButtonName.click();return false;}
    else return true;"
    Can any one help me better solution than this...
    Thanks in advance...

    Double-posted:
    http://forum.java.sun.com/thread.jspa?threadID=5131933
    (And this is still a java and not javascript forum)

  • Prevent ESC key from closing movie

    Hi!
    Can anyone please advise me how to stop a movie closing when the ESC key is pressed.
    I have a dialog function that opens another movie to confirm quit.
    I would prefer it to minimize instead of simply closing with no warning.
    Many Thanks
    Sarah

    You set 'the exitLock' to TRUE - check the docs for more details. Also, once the exitLock is true, you can implement an 'on closeRequest' handler to detect your using pressing the ESC key, or clicking the close box on the titlebar.

  • How to prevent Enter key from closing form?

    I have a page with a single text entry field on it. When I press enter the page closes, not saving the data (it is as if I clicked cancel). How can I change this behavior?

    Hi Daveio,
    Can you please let me know whether the Text Field that you have created is of type:
    Text Field (always submit page when entered pressed)?
    Secondly, does your page have any branches associated with it?
    Tony.

  • Pai module enter key from key board

    hi
    can any one tell me how can i display material description after entering material no in screen  .
    by just clicking enter key from keyboard .
    Regards
    Rakesh singh

    Use a case statement.
    CASE ok_code.
    When Others.
    *********Write code to read material description from table or Internal table ***********
    Pass the description to the field on the screen. To do this define a work area with same name of screen element
    End case.
    Now the value will automatically be populated.

  • In the address bar where type the address of the web site at the top. after entering the address i press enter key from the keyboard but it does'nt work there . Means the page is not navigating towards the address. Kindly solve the problem

    In the address bar where type the address of the web site at the top. after entering the address i press enter key from the keyboard but it doesn't work there . Means the page is not navigating towards the address. Kindly solve the problem

    This issue can be caused by an extension that isn't working properly.
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    * https://support.mozilla.com/kb/Safe+Mode
    * [[Troubleshooting extensions and themes]]
    In Firefox 4 you can use one of these to start in <u>[[Safe mode]]</u>:
    * Help > Restart with Add-ons Disabled
    * Hold down the Shift key while double clicking the Firefox desktop shortcut (Windows)

  • How can i distingush Enter key from Numpad-Enter(Enter key on numpad)?

    How can i distingush Enter key from Numpad-Enter key(Enter key on numpad)?
    Enter KeyEvent information is identical with Numpad-Enter key(Enter key on numpad) KeyEvent.
    ( keyChar, keyCode, ..etc)
    But i must differentiate these two Enter keys.
    How can i make it?
    Thank you for your answer ahead.

    The keyCode for 1 in the numeric pad is 97 the other 1 is 49, the same with 2 98/50. The same with all other numeric keypad.
    Noah

  • Ole web browser, prevent F8 key from firing

    Hi all,
    I have added an OLE Web Browser control to a window in PB11.2 and load a PDF document.  This works fine.
    But I want to prevent the user from pressing F8/right-clicking within the ole.  Because doing so allows the user to see the adobe reader toolbar (F8) / context-menu (right-click) which allows him to other stuff (save/print) which we dont want the user to do.
    I have been able to prevent the user from right-clicking inside the ole control via the following code (in "other" event):
    IF wparam = 516 THEN
        //disable right-click
        ole_control.POST SetFocus( )
    END IF
    However, am unable to prevent key event from being fired inside the ole control.  Does any one have any ideas/suggestions?
    Thanking you in advance.
    Cheers,

    Hi Roland,
    Thanks for your reply.
    I have decided to stop trying these work arounds (disable right-click, F8, etc)...
    instead, I now generate the pdf (as read-only) by encrypting it thus automatically disabling the save/print/etc functionality from the adobe reader.
    unfortunately, the mail button cannot be disabled (no idea how? why?).  So, I leave it here...
    Best,
    -a

  • How can I remove the "enter" key from the keyboard? (New Macbook)

    I have the last white macbook, I spilled beer in a couple of keys, I managed to removed them without problems, but I can't find the way to remove the Enter Key, and there is no help on internet Anyone?

    What characters are you talking about exactly and why would you want to remove any?
    There is really no way to modify Apple's keyboards or add your own in iOS, but there are some apps that may provide a work around.

  • Using Enter key from numeric keypad to enter and switch to next element in an array control

    Hello all,
    I have a question regarding a simple but annoying problem, of which I did not found a solution yet.
    I have written an application in which I have to enter data manually in a numeric array control.
    If I want to enter the value and go to the next element in the array control, i am forced to use the Tab key on my keyboard, or risk RSI using the mouse.
    How can I assign the Enter key of the numeric keypad section of my keyboard to to the same as the Tab key?
    Kind regards,
    Raymond

    [email protected] wrote:
    Can you convert the example in a image or can you convert in to 8.2.1 version?.
    Best regards
    Saved in 8.2.1 for you.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Change Array Event.vi ‏16 KB

  • Shapeshifter themes may prevent DVD Player from playing movie DVDs

    A user on Apple Discussions reported that every time they played commercial DVDs they got an
    "Error: `nilP`"
    When trying to play DVDs on their DVD Player software. Turned out the problem was a certain theme they had installed to use with http://www.unsanity.com/ 's Shapeshifter product. At the point of the writing of this FAQ, it is unknown which themes cause this issue. However, if you get this issue, please report the problem to the theme author and Unsanity so that the problem may be fixed. Always be sure that when you install system modification utilities like these that they are up to date for the operating system you are about to update to before updating to that operating system, and checking how to uninstall them if necessary before updating the operating system.

    Reset the NVRAM/PRAM and Reset the SMC, then try again.

  • Stop Enter key for acting in a JTable

    I am having some problems with scrolling because of the Enter key. I there a way to override or stop the enter key from acting in a JTable?

    The following code simulates a mouse click on a cell when enter is pressed. You should be able to change it to do nothing, or add other functionality.
    table = new JTable(model)
         protected void processKeyEvent(KeyEvent e)
               if ( e.getKeyCode() == KeyEvent.VK_ENTER
               &&   e.getID() == KeyEvent.KEY_PRESSED )
                   int column = table.getSelectedColumn();
                   int row = table.getSelectedRow();
                   Rectangle r = getCellRect(row, column, false);
                   Point p = new Point( r.x, r.y );
                   SwingUtilities.convertPointToScreen(p, table);
                    try
                         Robot robot = new Robot();
                         robot.mouseMove(p.x, p.y );
                         robot.mousePress(InputEvent.BUTTON1_MASK);
                         robot.mouseRelease(InputEvent.BUTTON1_MASK);
                         robot.mousePress(InputEvent.BUTTON1_MASK);
                         robot.mouseRelease(InputEvent.BUTTON1_MASK);
                         robot.mouseMove(0, 0 );
                    catch (Exception e2) {}
               else
                   super.processKeyEvent(e);
    };

  • Clearing the history causes the enter key and search button not to work

    If I clear my history and set my browser to never remember or suggest websites, the search button doesn't work. I can click on it but nothing happens. In addition, if I simply use the enter key from my keyboard, that doesn't work either. I have to reset firefox and then the new version will work (but if I go back and change all my history settings again and then it stops working). Please help.

    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information.
    Note: ''This will cause you to lose any Extensions, Open websites, and some Preferences.''
    To Reset Firefox do the following:
    #Go to Firefox > Help > Troubleshooting Information.
    #Click the "Reset Firefox" button.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
    Did this fix your problems? Please report back to us!

  • Problem while  capturing keys from keyboard .

    hello abapers,
    i am trying to catch my enter key from keyboard coz i want run some code when user will press enter.
    i think sy-ucomm will capture the key pressed, if i am wrong then plz correct me.
    (1) with this assumption i tried running bdc for my screen and tried to get the bdc_okcode value  which  is /00
         i passed this value to sy-ucomm in my abap prog but it didnt worked
    (2) i tried writting /h in command window it oppend the debugging window but the value for sy-ucomm was blank
    if any one of you is able to correct me it would be of great help to me plz its .....
    Thank you.
    Edited by: Dakshaini A Subramaniam on May 15, 2011 8:36 AM
    Edited by: Rob Burbank on May 15, 2011 4:21 PM

    Hi ,
    Double click your ,
    SET PF-STATUS 'STATUS'.
    code. At Standard Toolbar part of the pf-status  , set OK CODE for first item (green) to 'ENTER'.
    When user hits enter , sy-ucomm will be ENTER.
    This is for screen processing .

  • Trap enter key? please help

    how will i trap the enter key?
    example: jTextField1 has the focus or insertion point, if the user presses the enter key from the keyboard the next focus or insertion point will be on jTextField2.
    thank you in advance.
    killuasoft

    Swing related questions should be posted in the Swing forum.
    By default a "Tab" key is used as the "focus traversal key". You can also add the "Enter" key as a focus traversal key to any given component.
    I'll let you read the Swing tutorial for information on how to do this.

Maybe you are looking for

  • After iTunes 7 update can't get itunes to open or work

    OK...i recently updated to iTunes 7...and seemed to work fine then when i started up my computer today and tried to open up iTunes i got the message: "The iTunes Library.itl file cannot be found or created. The Default location for this file is in th

  • How to load data using Control File in BW 7

    Hi All, I have a requirement to load data in BW using control file. The development is done in in BW 7.0. In BW 3.5 in infopackage, there is an option of FILE IS ( Control File or Data File ). Please suggest how to simulate the same in BW 7.0 Regards

  • Software update for OS 10.0.10.738

    Hello,      Please how do I update my version to from 10.0.10.738 to 10.1? My carrier Tmobile has the update for 10.1 but they do not support my OS version because it is a third party phone,  they suggested I contacted blackberry. I am getting really

  • Error in conversion exit

    Hi, This is Bhu, New to this site, I am learning BW now, I am facing the following problem while loading the transaction data from flat file. Error message : error in conversion exit CONVERSION_EXIT_UNIT_INPUT. Kindly help me in sorting out this prob

  • How to give single multiple values

    Hi,   I am having one scenario like ,in one report if i had given multiple single values in select option parameter but it is taken only first value please can you suggest on this issue. Thanks, Harinath