dimensions of loaded swf's stage

前端 未结 2 1424
臣服心动
臣服心动 2021-01-05 02:50

Here\'s the situation - I\'ve got a shell that loads an external .swf. Now, that .swf is 800x600, but it\'s an animation piece, and there are elements that extends off the s

2条回答
  •  孤街浪徒
    2021-01-05 03:40

    The width and height of the loaded SWF as defined by the FLA it was created with can be found in the Loader object in which you've loaded the SWF into.

    swfLoader.contentLoaderInfo.width
    swfLoader.contentLoaderInfo.height
    

    This will always show you the dimensions as defined in the FLA properties. It makes no difference if any images, MovieClips, or what have you extend off the stage.

    The stage.stageWidth and stage.stageHeight properties will always return the width of the stage, the stage is always the top most SWF. In other words, it will always represent the dimensions of the shell's stage. There is only ever one stage in a Flash application.

提交回复
热议问题