开发者

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.


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;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜