Nick Lozano
Nick Lozano

Reputation: 23

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.

Upvotes: 0

Views: 319

Answers (1)

Azzy Elvul
Azzy Elvul

Reputation: 1438

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;

Upvotes: 0

Related Questions