praba
praba

Reputation: 1084

set default orientation for the android mobile view using flex 4 and action script 3

currently I am developing Video Conference system for android mobile using Flex 4 and action script 3. for video Chat I have 2 views, 1. Full screen view and 2. Normal Screen View. now the question is, how can I set the default display orientation for the view. when I click full screen, the view must load on "Landscape" orientation and when I click Normal screen, then the view must load "Portrait" view. I have tried the Stage.orients. but using that I can set only one orientation for an application.

<aspectRatio>portrait</aspectRatio>
<autoOrients>false</autoOrients>

 stage.autoOrients = true/false;
stage.setOrientation( StageOrientation.DEFAULT );

Kindly any one help me to solve this problem. Actually I can set default Orientation for One View. but I need to set Different Orientation for different Views. for FullScreen I need to set Landscape as default Orientation and for normal screen I need to set Portrait as default Orientation. any idea ?

Upvotes: 4

Views: 1606

Answers (1)

avladov
avladov

Reputation: 851

I do this by using setAspectRatio:

this.stage.setAspectRatio(StageAspectRatio.LANDSCAPE);

Just listen for addedToStage inside the view and change the orientation there.

Upvotes: 1

Related Questions