Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8031121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:59:15+00:00 2026-06-05T00:59:15+00:00

I am encountering a rather frustrating problem with a chat class I am putting

  • 0

I am encountering a rather frustrating problem with a chat class I am putting into a game.

Basically this is what is happening:

1) I listen for a KeyboardEvent.KEY_DOWN for the letter “t”. (“t” brings up team chat)

2) That then calls a class to make an input text field visible (Timeline Created).

3) I then stage.focus to that input text.

All works fine except that the letter “t” is appearing in my input text field.

So, I figured it was capturing the KeyboardEvent and inputting “t”, thus I created an event listener to trigger after the input text field is stage.focus’d to clear that input text field by calling inputText.text = “”;

However, it won’t work, instead of clearing it to “” it just leaves the “t”.

I experimented some more and tried to set inputText.text = “CLEAR” after the focus event.

Something strange happens where after all is said and done, the input text field shows “tCLEAR” with the cursor right after t and when I type in more, it pushes the “CLEAR” to the right.

As far as I know, any text field dynamic or input, if you set it to “”, it should clear it. However in this case its not, its just pushing the “” after the t.

Anyway, I have done a lot of searching, but to no avail.

I even have tried clearing to “” after a TextEvent.TEXT_INPUT and even removed the KeyListener after pressing “t”, still no joy.

Any help would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T00:59:18+00:00Added an answer on June 5, 2026 at 12:59 am

    You can add event.stopImmediatePropogation() in your KeyboardEvent.KEY_DOWN handler. Or if this won’t help try using KeyboardEvent.KEY_UP event to capture pressed button with event.stopImmediatePropogation() in its handler.

    EDIT

    Well, I don’t know why it’s important for you to do exactly that way with key down event. But I can suggest this solution:

    1) Add TextEvent.TEXT_INPUT listener to TextField in your key down handler.

    2) And in text input handler add event.preventDefault(); and remove TextEvent.TEXT_INPUT listener.

    Something like this:

    function keyDownHandler(event:KeyboardEvent):void
    {
        ...
        stage.focus = tf;
        tf.addEventListener(TextEvent.TEXT_INPUT, tf_textInputHandler);
    
    }
    
    function tf_textInputHandler(event:TextEvent):void
    {
        event.preventDefault();
        tf.removeEventListener(TextEvent.TEXT_INPUT, tf_textInputHandler);
    }
    

    Where tf is your textField.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm basically encountering the same problem as the poster in this question . My
I´m encountering this problem trying to mock some objects that receive complex lambda expressions
I suddenly started encountering this problem out of nowhere. My 'Manage Categories' page is
As the title boasts, I'm encountering a rather strange problem with Firefox where it's
Encountering a weird problem here. I'm developing a game for my school project (non-commercial),
I'm encountering this bizarre problem: the same code produces different results in Native Java
Im encountering a problem with pypi similar to this one, except that I'm running
I am encountering a problem while marshalling my Java objects using JAXB. When i
I am encountering a problem with codeigniter and JQuery Ajax Post. My javscript $('.remove').click(function(){
I am encountering a problem with string formatting while trying to get only the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.