How to force landscape on a Flash builder mobile app
Asked Answered
D

1

6

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.

Diarmit answered 20/2, 2012 at 21:39 Comment(2)
I am also facing the same problem. The simulator doesn't open landscape as default orientation.Hanoi
Currently the emulator seems to do the opposite of what you set in the app.xml file. I didn't notice this in 4.5, maybe it is a bug with 4.6?Arsenite
L
1

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);
Lockage answered 17/10, 2012 at 12:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.