If a mobile application has 4-5 views, is there a way to enable/disable orientation (portrait/landscape) for some of the views?
Add an event listener on the activate (or creationComplete) event of your view and the deactivate event of the view.
In those events listeners, add these lines :
protected function view_activateHandler(event:Event):void
stage.autoOrients = false;
protected function view_deactivateHandler(event:Event):void
stage.autoOrients = true;
You can then manually check or set the orientation if you want by using stage.orientation == StageOrientation.ROTTED_LEFT and stage.setOrientation(StageOrientation.DEFAULT) for example.
Thanks. I will try this out.
Make sure you use viewActivate/viewDeactivate events rather than activate/deactivate.