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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:21:10+00:00 2026-05-24T05:21:10+00:00

I am implementing an application timeout feature (flex4). What I am finding is that

  • 0

I am implementing an application timeout feature (flex4). What I am finding is that mouse and keyboard events, which I have listened to with :

FlexGlobals.topLevelApplication.addEventListener(MouseEvent.MOUSE_MOVE, resetLastActivity);
FlexGlobals.topLevelApplication.addEventListener(KeyboardEvent.KEY_DOWN, resetLastActivity);

are being masked by the existence of any popup windows. The code is in a component, in the constructor. The component is added to the main application in the block.

How can I get these system generated events to not get stopped by PopUpManager display objects?

Thanks!

  • 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-24T05:21:12+00:00Added an answer on May 24, 2026 at 5:21 am

    Try listening on the Stage instead of the topLevelApplication. access the stage using the stage property on the topLevelApplication

    I think topLevelApplication formally returns an object, so you’ll need to do something like this:

    (FlexGlobals.topLevelApplication as Application).stage.addEventListener(MouseEvent.MOUSE_MOVE, resetLastActivity);
    (FlexGlobals.topLevelApplication as Application).stage.addEventListener(KeyboardEvent.KEY_DOWN, resetLastActivity);
    

    Update:

    Keep in mind that the stage is not set in the topLevelApplication until that component’s creationComplete event is fired. If you are adding event listeners to the stage in a non UI class; you have to make sure this is not done until creationComplete fires in the topLevelApplication.

    To do this, add an event listener to the topLevelApplication’s creationComplete method in the constructor.

    (FlexGlobals.topLevelApplication.addEventListener(FlexEvent.CREATION_COMPLETE, onCreationCompete);
    

    If this is an MXML UIComponent, you can add that code in a preinitialize event handler instead of a constructor.

    Then this would be the creation complete handler:

    public function onCreationComplete(event:FlexEvent):void{
        (FlexGlobals.topLevelApplication as Application).stage.addEventListener(MouseEvent.MOUSE_MOVE, resetLastActivity);
        (FlexGlobals.topLevelApplication as Application).stage.addEventListener(KeyboardEvent.KEY_DOWN, resetLastActivity);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently implementing a client application that POST's a file over HTTP and have
I'm implementing an application that will have a lot of clients querying lots of
I am implementing game application.In which i have set UIView on camara overly.When i
I am implementing an application that which is having a UIWebView. My problem is
I have an application implementing incremental search. I have a catalog of unicode strings
I'm implementing an application which want to draw lines in the panel. But the
I'm implementing a Rails application in which users will be able to store snippets
While implementing XML file reading/writing in my application I saw that when I call
I am implementing an application. In that I need to find out a way
I am implementing an application which is used to draw images and text.User can

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.