How to get the width and height in ActionScript for a Flex application running inside the flash player in the web browser

apache-flexbrowserdimensionsembed

Does anyone know how to get the width and height in ActionScript for a Flex application running inside the flash player in the web browser.

e.g. In the web browser I can use the tag to embed a Flex application (as a .swf). To the embed tag, I can provide the dimensions. I would like to get these dimensions inside the flex application action script.

Thanks in advance,

Regards

Vivek

Best Answer

As of Flex 4.0, Adobe recommends using FlexGlobals.topLevelApplication instead of Application.application.

Depending upon what you are doing, you can look into using stage. But, if you do, be aware that the stage will grow to contain movie clips that go outside of the bounds of the application. So the stage is frequently larger than the actual application.

Related Topic