Directly-linked .swf files, i.e not embedded in a web page, seem to render at 100% of the browser window size. Is it possible to specify in the .swf file itself dimensions for the .swf to display at?
Thanks all,
Richard.
Directly-linked .swf files, i.e not embedded in a web page, seem to render at 100% of the browser window size. Is it possible to specify in the .swf file itself dimensions for the .swf to display at?
Thanks all,
Richard.
The SWF will always be rendered at 100%, but if you're producing the swfs you can control the size of content within them.
Yes you can, with PHP you can use the function getimagesize() which works with SWF files and return its dimensions.
I don't think there is a way to cause the SWF to open with a given dimensions if you'll point your browser directly to the file (http://www.mysite.com/somefile.swf). By doing that you tell the browser to do whatever it's default behavior when loading this file type (which can vary between browsers and computers).
You can stop the swf from scaling its content by choosing the stage scale mode. I think what you're looking for is stage.scaleMode = StageScaleMode.NO_SCALE
. Then, the swf will not scale at all and display at it's initial dimensions. The default, however, is StageScaleMode.SHOW_ALL.
In AS2:
Add the following code at the second frame (leave the first frame blank, putting the code in the first frame might give you false values):
Stage.scaleMode = "noScale";
Then you can access the stage's width & height using:
var myWidth:Number = Stage.width;
var myHeight:Number = Stage.height;
Note that there is no underscore before the width and height properties. Put your entire movie inside a single movieclip at the root and set it's relative size according to these values.
Let me know if that worked for you. Also: See my answer about the downside of linking directly to SWF files.