How do I find the original flash sizes?

I have a flash file that I want to find programmatically in my code. Right at the beginning of the code, I have a line:

[SWF(width='700', height='500')]

      

And a few subclasses later, I want to output these "700" and "500" values ​​as variables.

Is there a way to find this?

I've tried referencing this.width and this.height, but they always end in zero for the parent canvas.

The scene reference does not work as it returns the current scene size, not the desired size. For example, if I load the SWF directly rather than through the browser, I can scale the viewport as much or as small as I like.

+1


a source to share


2 answers


stage.stageWidth

and stage.stageHeight

will refer to the full width and height of the scene. It will change at run time if the Flash Player instance is resized. There's also loaderInfo.width

and loaderInfo.height

that should tell you the original values ​​given in the metadata [SWF]

and they won't change at runtime.



+1


a source


Turns out my original answer was wrong, check this for a very similar question: dimensions of the loaded swf stage



0


a source







All Articles