开发者

How to make an swf compatible with all screen resolutions?

开发者 https://www.devze.com 2023-01-04 20:04 出处:网络
I\'m not really sure how to go about it, but I\'d like to have the swf get as big as possible for each user without requiring scrolling. Of course it would stick to a certain ratio, currently I\'m usi

I'm not really sure how to go about it, but I'd like to have the swf get as big as possible for each user without requiring scrolling. Of course it would stick to a certain ratio, currently I'm using 2:1 but that could be changed (maybe I should use 16:9开发者_C百科 since it is the standard widescreen ratio).

I am only using Actionscript 3 for code and MXMLC for compiling.


Simply display the SWF (inside of the html) with 100% width and 100% height. That way it will use all the available space.

Then make sure you are setting Stage.scaleMode to no StageScaleMode.NO_SCALE and make sure that your content is able to redraw its layout based on the actual available space. In MXML you can do that by using Boxes and percental sizing and/or absolute margin positioning (by setting top/right/bottom/left to a fixed value on at least two sizes). If you are constructing the layout using code, you can make use of Stage.stageWidth and Stage.stageHeight to calculate the correct sizes of your elements and use the Event.RESIZE event to get notified when the movie changes it size for whatever reason.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号