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

  • Home
  • SEARCH
  • 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 8470151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:26:15+00:00 2026-06-10T16:26:15+00:00

How do I get the available browser width and height in Flex ( not

  • 0

How do I get the available browser width and height in Flex (not Flash)?

There is Capabilities.screenResolutionY and screenResolutionX that give the total monitor resolution and there is stage.stageWidth and stage.stageHeight but in the documentation it says “Calling the stageWidth property of a Stage object throws an exception for any caller that is not in the same security sandbox as the Stage owner (the main SWF file)”. AND at times the stage property is null (how do you even get it on non-display objects like if you were in some random class?).

So how would I do this the Flex way and not throw errors (my application may be loaded by another at some point)?

~~ UPDATE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
So I’ve been doing some testing and it looks like,

Rectangle(systemManager.getVisibleApplicationRect()).width
Rectangle(systemManager.getVisibleApplicationRect()).height 

give me the information I need. These are even available at Application initialize.

Also,

systemManager.stage.stageWidth
systemManager.stage.stageHeight

give me the same information.

The systemManager is a property on the Application and every UIComponent so unless I’m in one of those classes (and I think in UIComponent’s case it’s a child of the Application) I still need to find a way to get to a reference to the systemManager in other types of classes.

~~ UPDATE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
So freakazoid_em commented that I can use FlexGlobals.topLevelApplication to get the reference to the systemManager. With that I can get a reference to the visible browser width and height from anywhere in my Flex application (at anytime).

  • 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-10T16:26:16+00:00Added an answer on June 10, 2026 at 4:26 pm
    var visibleWidth:Number = FlexGlobals.topLevelApplication.systemManager.getVisibleApplicationRect().width;
    var visibleHeight:Number = FlexGlobals.topLevelApplication.systemManager.getVisibleApplicationRect().height;
    
    // this seems to return the same values
    var visibleWidth:Number = FlexGlobals.topLevelApplication.systemManager.stage.stageWidth;
    var visibleHeight:Number = FlexGlobals.topLevelApplication.systemManager.stage.stageHeight;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do I get the current height and width of the available space in
Is there any way to get available values for SET field in table? Thank
Is there a way to get the available resource translations of a .net dll?
Is there a .NET API available to get data from your XBox Live account?
How to get the classes that are available in a '.cs' file.? Like we
I want to get a list of all available datasets (that I'd creat in
The browser has a very efficient URL parser that let you get location.href ,
In PHP there's a function called stream_wrapper_register . With that i can get the
I am after a code to get the available column names of a table
I would like to get all possible available currencies. Java 7 had provided such

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.