Ankit
Ankit

Reputation: 4710

Getting embed tag's width/height in Actionscript

I am using the stage ScaleMode as NO_SCALE and want to know the width and height specified in HTML in the embed tag. Is there a way to go about it? I am using Flash Pro (not flex).

Basically I am trying to keep the UI flexible and hence I want to realign some UI components based on those values.

Upvotes: 0

Views: 190

Answers (1)

Marty
Marty

Reputation: 39456

Using:

stage.stageWidth
stage.stageHeight

Will give you the total width and height of the SWF as it's been embedded into a page or stretched in Flash Player.

To simplify working with an SWF that can have dynamic width and height, I recommend the following as well:

stage.align = StageAlign.TOP_LEFT;

Upvotes: 3

Related Questions