Stack Exchange
Capabilities showing wrong information
While accessing information using Capabilities, i am getting incorrect values.
var screenX:Number = Capabilities.screenResolutionX;
var screenY:Number = Capabilities.screenResolutionY;
var pixelCheck:Number = screenX * screenY;
var pixels:Number = (screenX*screenX) + (screenY*screenY);
var screenSize:Number = Math.sqrt(pixels)/Capabilities.screenDPI;
var screenDpi:Number = Capabilities.screenDPI;

trace("screenX : " + screenX);
trace("screenY : " + screenY);
trace("pixelCheck : " + pixelCheck);
trace("pixels : " + pixels);
trace("screenSize : " + screenSize);
trace("screenDpi : " + screenDpi);

When i debug this on the flex emulator, for iphone 4, i get the following result.
screenX : 1280
screenY : 1024
pixelCheck : 1310720
pixels : 2686976
screenSize : 5.028220260069967
screenDpi : 326

The Screen dpi is correct, but since iphone has a resolution of 640 X 960, why is it showing different value.

i think it is showing the rezolution for your system screen, but not from the emulator. Try: Capabilities.os, to figure out in which universe Flash player is.

yeah, Capabilities.os gives Windows 7

ok, i executed the app on a physical android device and got its exact resolution. So its only an issue with the flex emulator which actually gets the resolution and the operating system of the computer.

@JevgenijDmitrijev Even though I run code on Android, it reports it as Linux 3.10.73-gbc7f262

@IgorGanapolsky yes, that might be. My answer is back from 2012.. :) lot's of things might have changed since that...

This is expected behavior.  Capabilities class is returning the correct values; which is the screen resolution for the device you're running it on (aka not an iPhone ). 
You can file a bug report/enhancement request.  Or test it on an actual device.  Overall I find the emulators to be hit or miss in terms of testing.  

Anyone check those bug reports?
