Way to detect screen resolution in flex 4

adobeapache-flexdetectflashresolution

I want to make an application with an image that only bounces to the users screen resolution. How can I go by detecting the users screen resolution in flex 4? (If you can that is.)

Best Answer

From http://www.sapethemape.com/2009/01/detecting-screen-resolution-in-flexair/, it looks like you can use Capabilities.screenResolutionX and Capabilities.screenResolutionY.

Example:

private function CapabilitiesMax():void
{
    width = Capabilities.screenResolutionX;
    height = Capabilities.screenResolutionY;
    stage.nativeWindow.x = 0;
    stage.nativeWindow.y = 0;
}