Yesterday I came across a fact that you can resize the stage size dynamically at runtime using actionscript code. But this is limited to AIR only (either Flash or Flex) but not supported in normal Flash.
Following is the code to change the width and height of the stage at anytime (runtime) using actionscript in AIR (Flash) ::
stage.stageWidth = {numericValue};
stage.stageHeight = {numericValue};
Of course, we can change the width and height of the stage in Flash (normal) using JavaScript or some other external script which controls the container of the swf file.
Naresh Khokhaneshiya
Posted by caleem on July 30, 2009 at 9:05 pm
Hi I have tried binding the varibale to my stage width and hieght but this isnt working, the SWF width and height is the same as it was.
I am using Flex 3, and trying to change the SWF file width and height at the run time.
any suggestion ?
Posted by Naresh Khokhaneshiya on September 8, 2009 at 1:55 pm
@caleem,
If you are running your application in browser, then I think you can not change stage width and height from ActionScript. You can change it by external script such as JavaScript in this case.
If you are running in application in AIR, then only you can set/change stage width and height at run time.
Thanks,
Naresh