Skip to main content
Known Participant
Sep 7, 2011 3:55 AM UTC
Question

Lock vertical orientation just for a moment

Hello

I'm building this App that is almost all in landscape, but I need to lock the vertical screen for the options,

I've tried adding a event listener to the stage for Changing but doesn't work ... I´m working in Flash CS 5

Anyone knows how to lock the orientation for portrait just for a part of the code?

Thank you

This topic is closed to new replies. Start a new post to keep the conversation going.

3 replies

Inspiring
Sep 7, 2011 3:56 PM UTC

//if you allow the autoOrientation of the screen

stage.autoOrients = false;

//if you want to force an orientation.

stage.setOrientation(StageOrientation.ROTATED_RIGHT); // (or any other orientation of your choice)

If you disable the autoOrientation, don't forget to reenable it.

Translate
Known Participant
Sep 8, 2011 1:50 AM UTC

Thanks but stage.autoOrients is read-only in CS5

Finally I mannaged in diferent way ... thanks guys, youre great!

Translate
Colin Holgate
Inspiring
Sep 7, 2011 4:09 AM UTC

If it's for Android, there isn't a Changing event, only a Changed one. If it's iOS, what does your code look like?

Translate