Skip to main content
Inspiring
December 14, 2011
Question

Mobile Screen size

  • December 14, 2011
  • 2 replies
  • 1102 views

Is there any way to detect the mobile screen size of a device.  I know you can get the pixel capability but some phones now have HD screens with similar pixel capacity to tablets.  My galaxy nexus is displaying the tablet version but I would rather it do the phone version.  Not sure if there is any physical size we can pull to make a more intelligent decision on which layout to show.

This topic has been closed for replies.

2 replies

Participant
December 14, 2011

The Capabilities class provides properties that describe the screen.  I've used the dpi to help make things look correctly on these different highres smaller screens.

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/system/Capabilities.html

Greg

mola2alexAuthor
Inspiring
December 14, 2011

Looks promissing, I will give it a shot!  Much appreciated!

Inspiring
December 14, 2011

Hi, you can check this in stage object:

stage.fullScreenWidth and stage.fullScreenHeight

this return you the maximum width and height of device.

mola2alexAuthor
Inspiring
December 14, 2011

That returns pixels which is what I have used previously.  I am looking for physical dimensions to understand how many cm's or inches the screen is so I can format correctly.  My tablet and galaxy nexus phone have almost the same height and width in pixels but I definitely do not want the same UI to be displayed.