Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to force landscape on a Flash builder mobile app

I am building a mobile application using Flash Builder. I am testing on a Motorola Xoom. When the app opens on the attached Xoom it opens with the correct orientation (landscape), but when it opens on the computer in the emulator it is backwards (Portrait).

I have specified the ratio and orientation in the *-app.xml:

<aspectRatio>landscape</aspectRatio>
<autoOrients>false</autoOrients>

I'm assuming it is a bug but it is possible that I am missing something or that there may be a fix.

like image 316
David Avatar asked Feb 20 '12 21:02

David


1 Answers

In my case, neither was working. So, for the desktop version, I've made an ugly thing: duplicated the aspectRatio property above the others, after title property. I don't know if the position of the property matters, but that way it worked.

There is just one problem with this approach: when building the debug version of your application all works fine (including in mobile), but when you build the release version, an error occurs saying that the aspectRation property is unexpected. Just remove one of them and the build will work.

Just for the register, to make it work in mobile, I had to set the property aspectRatio in the code too, like this:

stage.setAspectRatio(StageAspectRatio.LANDSCAPE);
like image 122
Kleber Avatar answered Nov 02 '22 07:11

Kleber