O'Reilly logo

Flash Development for Android Cookbook by Joseph Labrecque

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Freezing a Flex application to landscape or portrait mode

It is sometimes desirable to constrain your application layout to a specific aspect ratio, landscape, or portrait. When building Android projects using the Flex framework, it is a simple matter to accomplish this.

How to do it…

We can freeze a particular aspect ratio for our application by modifying the AIR application descriptor file:

  1. By default, when we define a new Flex mobile project, an application descriptor XML file is created. This file includes a node dedicated to the application initialWindow configuration. It will appear similar to the following code:
    <initialWindow> <autoOrients>true</autoOrients> <fullScreen>false</fullScreen> <visible>true</visible> <softKeyboardBehavior>none</softKeyboardBehavior> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required