简体   繁体   中英

AS3 Flash/Air resize for mobile device

So I make games with Adobe Flash/Air. Recently been experimenting with making games for mobile devices. I took a simple game I made and did all the steps necessary to get it working on my phone (IOS). Works fine and all but it doesn't resize to fit the screen. I know I could just make my stage height/width fit the screen size of my device but what if the game was played on a phone with a different screen size - it wouldn't fit.

Now I've researched this for days and I found that you had to use: stage.align=StageAlign.TOP_LEFT; stage.scaleMode=StageScaleMode.NO_SCALE;

The problem is that when I use that code I get a compile errors (access of undefined property) for both StageAlign and StageScaleMode...

What am I missing? Is there something I have to import into the package? Again, I'm only using Flash and Air to make my game.

You must import it to access it.

import flash.display.StageAlign;
import flash.display.StageScaleMode;

In timeline you can omit those imports but they are required in classes;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM