Question

I´m trying to do this for 2 days and no success. One, and only one view (the video record view) I need to force to start in landscape. All the other views must start in portrait. And... Landscape view and the others portrait views must not rotate if the user rotates the device.

I´m trying with stage.setAspectRatio(StageAspectRatio.PORTRAIT) for portrait views and stage.setAspectRatio(StageAspectRatio.LANDSCAPE) for landscape view. Sometimes works... Sometimes not. Sometimes going from a portrait to landscape works but when I return to the caller portrait view, its rotate to landscape too.

Thanks for some help.

Was it helpful?

Solution

If you didn't already, take a look at this article that should be really useful to you: StageAspectRatio Enhancements in AIR 3.3

You could of course play with setAspectRatio to define starting orientation, but that's only part of the problem.

You can modify the autoOrients property located in your app descriptor file if you want to get rid of the automatic behavior and handle everything manually. Or you could listen for every orientationChanging event of the Stage object and preventDefault() them to cancel any screen orientation.

Once this is done, you simple have to handle the loading orientation of your views and this should be it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top