Clearing the TextArea texts when I press Enter key

How to clear the texts that I have typed into the TextArea when I press Enter Key?
I have now added a TextArea instance called input_txt to the stage and added an component event listener to detect when I press enter key. Then an event fires up which first reads the input to a string variable.
But next I need to automatically clear the texts in the TextArea.
How to do that?
function readInput(event:Event):void
    input = input_txt.text;
    trace(input);
    // removing texts in the text input area-------- how?
input_txt.addEventListener(ComponentEvent.ENTER, readInput);
Please help.
Thank You

ComponentEvent.ENTER occurs before the line feed is added to the text, and is not cancelable, so you'll probably need to set a flag and do the clearing in an Event.CHANGE handler. Something like this:
import fl.events.ComponentEvent;
input_text.addEventListener(ComponentEvent.ENTER, readInput);
input_text.addEventListener(Event.CHANGE, changeHandler);
var clearing:Boolean=false;
function readInput(event:Event):void
    input = input_txt.text;
    trace(input);
    clearing=true;
function changeHandler(event:Event)
if(clearing)
  input_text.text="";
  clearing=false;

Similar Messages

  • TS3048 my screen has frozen on problem loading page, my wireless mouse does not connect to the screen (its got new batteries). the keyboard works when you press enter.

    My mouse (new batteries and wireless), does not connect to my screen on my mac. The screen responds when I press enter, but I cannot move around it as there is no mouse.  The screen has frozen on 'problem loading page'.

    My mouse (new batteries and wireless), does not connect to my screen on my mac. The screen responds when I press enter, but I cannot move around it as there is no mouse.  The screen has frozen on 'problem loading page'.

  • MODULE POOL WHEN WE PRESS ENTER KEY IN A TBL CONTROL THEN CURSOR GO TO FIRS

    DEAR ALL,
                    IN MODULE POOL WHEN WE PRESS ENTER KEY IN A TBL CONTROL THEN CURSOR GO TO FIRST INPUT/OUTPUT BOX  I WANT THE CURSOR WILL STAY ON THAT TBL CONTROL COLUMN.
      PLZ TELL ME HOW I CAN DO THIS.
    THANKS
    SHASHI
    Moderator message: no upper case please, search for available information before posting.
    Edited by: Thomas Zloch on Mar 11, 2011 11:50 AM

    Hi,
    This is possible only for check boxes and radio buttons.
    for others you atleast need to double click.
    please note double click is possible.
    regards
    Ramchander Rao.Krishnamraju

  • Lines appear under all text when you press enter--edit?

    Hello,
    I have a text box, whose formatting I want to edit.
    When you press enter a horizontal line appears automatically before you enter in text on the new line. I want to edit this line so it is closer to the text.
    Where do I go to edit this feature? I already looked in text frame options and I know that it is not a style.
    Thanks,

    Sounds like a paragraph rule.

  • How to show a relevant value in alv table, when i press enter key

    I created a alv table. in this table there is a column called user id, and the other column called user name.
    what do I want:
    i wanna input a value in column user id eg. user id = D1111; when i press the enter keyboard, the column user name will be shown the value, which is relevant with user id.

    Hi,
    My first idea :
    Catch the event enter in ALV and select the name using the userid.
    This will be useful:
    Event Handler onEnter in ALV
    ON_DATA_CHECK - Web Dynpro for ABAP - SAP Library
    also this:
    ON_CELL_ACTION - Web Dynpro for ABAP - SAP Library
    Have fun,
    Hancila

  • Search bar doesnt launch a search when I press Enter key

    When I type something in the search bar, it shows me suggestions. On pressing Enter, it selects the highlighted suggestions. Now that I press Enter again to launch the search query, nothing happens. Search query doesnt go to the network till I mouse-click the lens icon in the search bar.
    This works fine in my windows machine, so I know it is a supported feature.

    No, problems here on Linux with the search bar and the Enter key.<br />
    Do you have the official Firefox version from the Mozilla site or a special Ubuntu branded version?<br />
    Ubuntu usually makes a lot of changes to their branded version and it is possible that they have disabled the Enter key.<br />
    You can try the version from the Mozilla site to see if that works better if you have the Ubuntu version.
    *Firefox 5.0.x: http://www.mozilla.com/en-US/firefox/all.html
    You can create a new profile as a test to check if your current profile is causing the problems.
    See Basic Troubleshooting: Make a new profile:
    *https://support.mozilla.com/kb/Basic+Troubleshooting#w_8-make-a-new-profile
    There may be extensions and plugins installed by default in a new profile, so check that in "Tools > Add-ons > Extensions & Plugins" in case there are still problems.
    If that new profile works then you can transfer some files from the old profile to that new profile (be careful not to copy corrupted files)
    See:
    *http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

  • How can i select the next column instead of next row when press enter key

    I need to know how can i select the next column instead of next row when i press the enter key.By default ,when i press enter key the next row is selected and the column remain unchanged but I wants opposite that is the row should remain unchanged but column index will changed.
    Thanks to all.

    Well, the right arrow key will already move you to the next column, so the easiest way to do this is to modify the InputMap to have the Enter key invoke the same Action as the right arrow key.
    You can search the forum for my "Table Actions" (without the space) example that will show you how to do this.

  • Pressing Enter key twice should submit the form

    I am trying to enter the chinese characters in the text box, chinese chracters will become a whole word only when we press the Enter key. But after entering a chinese character , if I press the enter key then the form got submitted. Instead the form should get submitted only when we press Enter key for the second time.
    Is it possible with Javascript?

    karthi23 wrote:
    I am trying to enter the chinese characters in the text box ...Where? An Java application? Your browser?
    Is it possible with Javascript?This is a Java forum. JavaScript and Java are two completely different things. You better find a JavaScript forum to ask this question.

  • Empty cells will be filled when you press ENTER

    Hello Experts,
    how can you do the following
    I type in a particular cell any number (3 or 4 or 8 etc.) and all the
    empty cells in the ALV should be filled witt the enterd number when I press ENTER
    Is somewhere a tutorial or an example ?
    Regards
    Sas

    first read the value ... then loop at screen .  ,, then give the all fields value equal to that value .... then change screen ..

  • How to get input values till pressing enter key

    hi!!!
    i need to enter values thru keyboard using bufer reader etc etc
    but i need to stop entering when i press enter key
    how to do this??

    First off I would take a look at this link because it gives quite a few good examples if you've never used scanner.
    You can find all this on the link.-> http://java.sun.com/j2se/1.5.0/docs/api/java/util/Scanner.html
    in order to use scanner you have to import it.
    import java.util.Scanner;then inside your main method you need to create a scanner wrapped around the keyboard inputstream.
    Scanner userIn = new Scanner(System.in);take a look at the api to decide which method you want. For this I would suggest nextLine().
    also I would specify that you want the numbers separated by spaces or comma's or something so you can use the String.split(" "); method which returns an array of Strings;
    then traverse through the array of strings and convert them to ints
    http://www.rgagnon.com/javadetails/java-0004.html

  • How can i display the values in a table when i press enter

    hi,
    I have three text boxes and a table with three columns in a jsp page.When i keyin some values in the text boxes and press Enter these values should be dispalyed in the three columns of the table.When once again if i key in the text boxes with some other values these values should also be displayed in the table columns in another row.Can it be done.Pls help me.Hoping for a reply.
    Thanks
    Naveen

    hi
    just go through the Code below:
    this helps you but this works in IE only.
    <html>
    <head>
    <script language="javascript">
    <!--
         function show(frm) {
              Show.innerText = frm.desc.value;
         } // closing the function show()
    //-->
    </script>
    </head>
    <form name="testform">
    <textarea name="desc" rows="3" cols="20"></textarea>
    <input type="button" name="buttsub" value="Submit" onClick="javascript:show(this.form)">
    <br>
    <table width="500">
    <tr><td bgcolor="#e6e6e6">
    <div id="Show"> </div>
    </td>
    </tr>
    </table>
    </form>
    </html>
    Cheers
    rambee

  • When I am on my home screen on the iPhone, swipe left to the search page. Put a letter in the search field. then scroll down. eventually you get to all your texts previously deleted or not. The are all there. How can I clear the entire text from the phone

    When I am on my home screen on the iPhone, swipe left to the search page. Put a letter in the search field. then scroll down. eventually you get to all your texts previously deleted or not. The are all there. How can I clear the entire text from the phone

    When I am on my home screen on the iPhone, swipe left to the search page. Put a letter in the search field. then scroll down. eventually you get to all your texts previously deleted or not. The are all there. How can I clear the entire text from the phone

  • Is there a way? When I type something in the search engine feature, is there a way that when I press enter to search, it comes up in a new tab, rather on the page I am using?

    When I type something in the search engine feature, is there a way that when I press enter to search, it comes up in a new tab, rather on the page I am using?

    Yes, and I presume you mean both the search engine results, and the pages opened from the results.
    Without making any changes you could always use '''Alt+Enter''' once you typed something into the search bar, or the location bar so that it would appear in a new tab. From the search results page you could always use "'''Ctrl+click'''" or "'''Ctrl+Shift+click'''" to open link n a new tab
    * Firefox and other Browser Keyboard Shortcuts (Comparison Table)<br>http://dmcritchie.mvps.org/firefox/keyboard.htm
    * Keyboard shortcuts | How to | Firefox Help<br>https://support.mozilla.com/kb/Keyboard%20shortcuts
    The configuration entries of interest:
    * '''browser.search.openintab''' user set boolean '''true'''
    * '''browser.tabs.openinnewtab''' user set boolean '''true'''
    Documentation
    * http://dmcritchie.mvps.org/firefox/tabs_config.htm
    * http://kb.mozillazine.org/About:config_entries (I use keyword shortcut of :"aboutconfig:" )
    * http://dmcritchie.mvps.org/firefox/tabs.htm
    Google settings:
    * [x] Open search results in a new browser window.
    :By default Google opens links in its search results to the same new tab, but I believe that the configuration changes supplied also fix that because I no longer have to use the keyboard shortcuts to override.
    Tools ("Alt+T") > Options > Tabs
    * [x] Open new windows in a new tab instead

  • When I enter a search in the Mozilla Start Page and press enter the browser does nothing. It doesn't bring in any search results. I use Windows Vista pack2

    I just upgraded Firefox for windows to version 21.0
    After upgrading, when I enter a subject to search in the search box (in the middle of the page) of the Mozilla Start page and press enter nothing happens. It doesn't bring in any search results.
    The only way to navigate using the browser is to enter the website name in the address box at the top of the page and press enter. I'm running the browser for Windows Vista - 32 bits.
    I tried re-installing firefox and I got the same result. I also tried re-booting after installation and it still behaves the same way.
    Please help,
    Thank you,
    Hektor

    he man check here
    '''Try Firefox Safe Mode''' to see if the problem goes away. Safe Mode is a troubleshooting mode, which disables most add-ons.
    ''(If you're not using it, switch to the Default theme.)''
    * You can open Firefox 4.0+ in Safe Mode by holding the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * Or open the Help menu and click on the '''Restart with Add-ons Disabled...''' menu item while Firefox is running.
    ''Once you get the pop-up, just select "'Start in Safe Mode"''
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one. Please follow the [[Troubleshooting extensions and themes]] article for that.
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    ''When you figure out what's causing your issues, please let us know. It might help other users who have the same problem.''
    Thank you.

  • I can't put numbers on the decimals. It only allow ,00 as decimals. If i put 33.00 it's ok but i i put 33.44 when i press enter changes to 3344 as an entire number, i've try everything and can't find the solution. This should be a basic thing.

    I can't put numbers on the decimals. It only allow ,00 as decimals. If i put 33.00 it's ok but if i put 33.44 when i press enter changes to 3344 as an entire number, i've try everything and i can't find the solution. This should be a basic thing. How frustrating !!

    pedrofromsydney wrote:
    €          55,555.00
    that's the result i get. Still why can't i just type for ex. 29.55 and stay like that on the cell ? Why does it always change to 2955 or 2955.00. ??
    I don't understand this
    It appears you have the cell formatted to Currency, with the default two decimal places.
    What I don't understand, though is how Numbers arrived at a result of fifty five thousand five hundred fifty five on your entering the exact keystrokes in Yvan's post:
    an equals sign, followed by five ones, followed by a forward slash, followed by a 2.
    Here's the result I get:
    Could you do the following:
    Open a NEW Numbers document using the Blank template.
    Drag the Row and Column control (bottom right corner) to reduce the table to two columns and three rows.
    Enter the words "My table" in cell A1.
    Click on cell B2 to select it, then enter the formula 
    =11111/5
    Use only those eight keystrokes; do not include any commas, periods or other characters not shown.
    Click on B2 again to select it.
    Open the inspector and choose the Cell Format button.
    Do not make any changes in the Inspector window.
    Drag the Inspector window to the position shown in my screen shot.
    Take a screen shot that includes the Formula bar, the Table (with cell B2 selected) and the Cell Format Inspector pane (the same screen area as in my screen shot above).
    Post the screen shot in a reply to this post.
    I'm hoping there will be some clues as to what's happening here in the screen shot. Procedure for taking and posting a shot of part of the screen follows.
    Regards,
    Barry
    SCREEN SHOTS (Selected area)
    Place the mouse pointer at the top left corner of the area you want to include.
    Press shift-command-4.
    The mouse pointer will change to a plus sign on a circle.
    Hold down the mouse button and drag to the bottom right corner of the area you wan to capture.
    Release the mouse button.
    The screen shot will be saved to your desktop with the name "Picture 1" (The number will be different if you have taken other screen shots).
    POSTING
    In the Compose frame, place the Insertion point at the location you want the picture to be inserted.
    Click the camera icon above the compose frame to open the Insert Image dialogue.
    Click Choose file to open the Choose dialogue.
    If necessary, navigate to the Desktop and click on the 'by date column header to sort the files by date, most recent at the top.
    Select the most recent picture file.
    Click Choose.
    Wait for the picture's file name to appear beside Choose file.
    Click insert image.
    Done.
    B.

Maybe you are looking for