Skip to main content
Inspiring
October 24, 2016
Answered

Scaling an Adobe AIR application to fit multiple resolution devices

  • October 24, 2016
  • 1 reply
  • 1012 views

Hi,

I have another problem. Right now I'm trying to provide multiple resolutions in flex-spark air mobile app.

Application is based on ViewNavigation and has many views triggered via .pushView() method.   Each view has own skins with custom backgrounds, etc..

There are many elements on each view, so I decided that I will recognize view as HD canvas 1080x1920.  Moment ago I've checked that there are many problems with different devices - many resolutions and DPIs.

In my ViewNavigatorApplication I wrote method:

  protected function preinitialize():void {

       this.scaleX = systemManager.stage.stageWidth/1080;

       this.scaleY = systemManager.stage.stageHeight/1920;

  }

and also removed "applicationDPI" definition.

Almost works...    On each view it works but problem exists during transitions between views.  I've seen fragment (about 1/4) upper left part of screen with animation.

Any idea how to solve it or other nice method for proper scaling?

Best regards,

Piotr

This topic has been closed for replies.
Correct answer piotrk92086443

Solved.  Assigning dimension works.

  protected function preinitialize():void {

       this.width = 1080;

       this.height = 1920;

       this.scaleX = systemManager.stage.stageWidth / 1080;

       this.scaleY = systemManager.stage.stageHeight / 1920;

  }

1 reply

piotrk92086443AuthorCorrect answer
Inspiring
October 24, 2016

Solved.  Assigning dimension works.

  protected function preinitialize():void {

       this.width = 1080;

       this.height = 1920;

       this.scaleX = systemManager.stage.stageWidth / 1080;

       this.scaleY = systemManager.stage.stageHeight / 1920;

  }