Skip to main content
Participant
Oct 27, 2010 6:45 PM UTC
Question

Flex Hero MobileApplication: How can I detect device screen resolution?

Hi all,

As the topic title already shows:

Flex Hero MobileApplication: How can I detect device screen resolution?

Thanks a whole lot!

Kind regards,

Jochen         

This topic is closed to new replies. Start a new post to keep the conversation going.

3 replies

Nov 9, 2010 8:11 AM UTC

I'm unsure as the correct way as well...

When running a MobileApplication, I have to add an ENTER_FRAME listener just to wait until the stage becomes non-null. Then after that happens, I can access the stage properties. The width and height properties do actually output the correct values, unless I have images that extend greater than those values...then it changes to those new width and height values!?!

I haven't tested within an actual device, but only within the emulator.

Translate
Participating Frequently
Nov 10, 2010 6:28 AM UTC

I believe stage.width/stage.height will change based on the content of your application.  If you use stage.stageWidth/stage.stageHeight instead does that return the dimensions you are looking for?

Translate
Nov 10, 2010 12:44 PM UTC

Oooh duh! Yes that was it...wow definitely been away from Flex for too long. Thanks for the help

Translate