Skip to main content
Participating Frequently
Aug 4, 2011 10:37 AM UTC
Question

Start app in landscape mode locked and later enable autoOrients

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 is closed to new replies. Start a new post to keep the conversation going.

6 replies

Known Participant
Aug 8, 2011 8:11 AM UTC

So, is this possible? I hope so.

Translate
Inspiring
Aug 10, 2011 6:18 PM UTC

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?

Translate
Participating Frequently
Aug 10, 2011 7:22 PM UTC

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).

Translate
PabloReyNAuthor
Participating Frequently
Aug 4, 2011 3:26 PM UTC

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

Translate
Inspiring
Aug 4, 2011 12:14 PM UTC

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

Translate