Here’s the situation – I’ve got a shell that loads an external .swf. Now, that .swf is 800×600, but it’s an animation piece, and there are elements that extends off the stage. When I load the .swf into the shell and call its width attribute, it returns 1200 – because it’s including the elements that break out of the stage.
This isn’t what I want – ideally, there would be two properties, one to return the ‘calculated width’ and one to return the ‘default width’. Do these properties exist, and if not, what’s the best workaround?
The width and height of the loaded SWF as defined by the FLA it was created with can be found in the
Loaderobject in which you’ve loaded the SWF into.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.stageWidthandstage.stageHeightproperties 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.