Skip to main content
Participating Frequently
August 4, 2011
Question

Start app in landscape mode locked and later enable autoOrients

  • August 4, 2011
  • 3 replies
  • 1269 views

Hi!

I want to start my app in landscape mode locked and when an effect finished unlocks autorients to true and the user can change the orientation.of the device.

I have tried few things but i can't get it. My descriptor file contains:

<aspectRatio>landscape</aspectRatio>

<autoOrients>false</autoOrients>

And in my code when the effect is finished:

stage.autoOrients = true

When i play my app in desktop it run but later running it in a phisichal device (playbook) orientation its ever locked.

¿Is posible lock orientation (and force landscape mode) and later unlock orientation?

Thanks so much!

This topic has been closed for replies.

3 replies

Known Participant
August 8, 2011

So, is this possible? I hope so.

Inspiring
August 10, 2011

There are a lot of situations where this is needed (i made a "drawing" widget that allow the user to draw over a photo)... On a tablet, you have the reflex of moving the device to draw in a different angle... but right now, the UI will also rotate! I cannot just disable the autoOrient because the application contains other views that must autoOrient.

Adobe? Is it possible? Will it be possible in AIR 3?

Participating Frequently
August 10, 2011

You should be able to do this now (AIR 2.6). The Stage.autoOrients property used to be read-only, but now it is writable. The main gotcha is that when you set Stage.autoOrients to false, the exact result is device-dependent. You might have it lock to the current orientation, or it might switch to the device default orientation and lock to that (you can still use setOrientation() to change, though). In my limited testing (3 devices), it has always done the latter (portrait is the default on phones, landscape on tablets).

PabloReyNAuthor
Participating Frequently
August 4, 2011

Its very necesary when our app start with an intro in only landscape mode...

Inspiring
August 4, 2011

Same question... I tried a few things but didn't find a way to do it... Is it possible? It should :S