Skip to main content
Known Participant
September 7, 2011
Question

Lock vertical orientation just for a moment

  • September 7, 2011
  • 2 replies
  • 637 views

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 has been closed for replies.

2 replies

Inspiring
September 7, 2011

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

Known Participant
September 8, 2011

Thanks but stage.autoOrients is read-only in CS5

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

Colin Holgate
Inspiring
September 7, 2011

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?