How to set an AS3 application size according to the screen size (for mobile devices)?

≯℡__Kan透↙ 提交于 2019-12-02 05:43:29

If you want the dimensions of your app to change according to the browser's size, you need to do a number of things:

  1. Set the width and height of the SWF to 100% in the HTML embed code

  2. Since you are going to handle the layout of the app yourself, you also need to set the scale property to noscale (still in the embed code)

  3. In Flash set stage.scaleMode = "noScale" then use stage.stageWidth and stage.stageHeight to get the size of the browser's window, and to layout your application.

  4. Finally, consider listening to Stage.RESIZE to update the layout when the browser's window changes.

All this would apply to a regular browser as well as a Flash app running in a mobile phone.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!