views:

555

answers:

2

Hi all,

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

A: 

I Flex you can access Application.application.height and Application.application.width.

Markus Johnsson
Selected this as the correct answer as it meets my current requirements. Thanks Markus !!
A: 

You can use stage.stageWidth/stage.stageHeight. Be sur to call that from a DisplayObject that is on the display list or else stage is going to be null. It works for both Flex and Actionscript projects.

sharvey