Skip to main content
Participant
October 27, 2010
Question

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

  • October 27, 2010
  • 1 reply
  • 1023 views

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 has been closed for replies.

1 reply

November 9, 2010

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.

Adobe Employee
November 10, 2010

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?

November 10, 2010

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