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 3691772
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:11:07+00:00 2026-05-19T04:11:07+00:00

I have a Sprite which is a child of a Flex object, and acts

  • 0

I have a Sprite which is a child of a Flex object, and acts as the main “game window”. So during game-play it should get keyboard input but at other times not. When I add a keyboard listener to it, it never fires.

Do I need to stop parent objects ‘eating’ the events somehow, or something similar? I get the same thing with mouse-wheel events, but mouse-click events are fine. Sprite doesn’t seem to have the concept of focus unless I missed it.

More generally in this kind of approach, are there any suggestions on the best way? For instance some keys might still be needed to be intercepted before getting to the game-window, like ESC or F1 or something… the aim is the game-window isn’t aware of other UI.

  • 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-05-19T04:11:08+00:00Added an answer on May 19, 2026 at 4:11 am

    Your sprite needs to have input focus to receive Keyboard Events.

    As for best practices: If your entire application is based on keyboard input, and if you don’t have to switch contexts ( the same key means a different thing if another object is selected ) a lot, you could just add the listeners to the stage.

    Otherwise, you can use stage.focus to set the focus to the desired object.

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

Sidebar

Related Questions

I am developing a Game in which sprite have to jump forward . I
I have a class which extends the Sprite object in as3. I need to
If I have a sprite, with which I have drawn some stuff, how do
I have a MapTile class which holds a tile sprite and the tile's attribute.
I have an image which is made up of 2 images, a sprite. What
I have a line, which is a sprite made by using this code CGPoint
I have a sprite which i animate using CCAnimate. the animation is composed of
I have a sprite sheet which has each image centered in a 32x32 cell.
My problem: I have created a parent sprite which rotates forever. I have created
I have a scene, a main layer and a child layer, the main layer

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.