Copy link to clipboard
Copied
Does anyone know how to scale a SWF in the browser window, but not larger than the original stage size in the FLA file? For instance, I've designed a course in Flash with stage size of 1024x768 in Flash. In the published HTML document, I change the following values:
'width', '1024' changed to 'width', '100%'
'height', '768' changed to 'height', '100%'
'scale', 'noscale' changed to 'scale', '100%'
These changes in the HTML source code allow the SWF to size with the browser, but I don't want the SWF to grow larger than 1024x768 if the browser window is greater than these dimensions. I want the max size of the SWF to be 1024x768 regardless of the browser window.
Does anyone know how to achieve this in the HTML source code and/or AS2?
Thank you!
Copy link to clipboard
Copied
use a stage onresize listener to control the size of your flash display
Copy link to clipboard
Copied
In addition to my original post, I took the advice to use the onResize listener, but am running into several issues described below the following code:
Stage.align = "TL"; //doesn't work; why?
Stage.scaleMode = "noScale";
var stageListener:Object = new Object();
stageListener.onResize = function():Void
{
if(Stage.width < 1024.0 || Stage.height < 768.0)
{
trace("The movie should be scaling");
Stage.scaleMode = "scale";
}
else
{
trace("The movie should not be scaling");
Stage.scaleMode = "noScale"; //doesn't work; why?
}
}
Stage.addListener(stageListener);
The above code works partially, but then stops, i.e. when I press CTRL + ENT to test the SWF:
Thanks for any help you can offer.
Copy link to clipboard
Copied
click file/publish settings/html and select percent, 100 x 100. retest.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more