How to enable orientation change for some views in Flex Mobile?

I have some views in my mobile app (for both ios and android) whose orientation was fixed to PORTRAIT using <aspectRatio>portrait</aspectRatio><autoOrients>false</autoOrients> in the settings xml file.

Now I have added another view which plays video from Youtube and it should be able to play videos, both in LANDSCAPE & PORTRAIT orientation. So I came across this question which provides a solution to restrict only 1 orientation (globally for all views), but how can I re-enable orientation change only for one view?

Note: I am using Flash Builder 4.6 with actionscript 3 and youtube api

Any help is appreciated :)


Remove the <aspectRatio>portrait</aspectRatio><autoOrients>false</autoOrients> from XML, as it will generalize it for the whole application.

Do it seperately for each and every view. Since for first view you need a PORTRAIT,do it like this.(Taken from Adobe Docs)

stage.addEventListener( StageOrientationEvent.ORIENTATION_CHANGING, onOrientationChanging ); 

function onOrientationChanging( event:StageOrientationEvent ):void {
    // If the stage is about to move to an orientation we don't support, lets prevent it
    // from changing to that stage orientation.
    if(event.afterOrientation == StageOrientation.ROTATED_LEFT || event.afterOrientation==StageOrientation.ROTATED_RIGHT ) 

For the second view, Do not define any stage orientation listeners, as you need both PORTRAIT and LANDSCAPE.

Need Your Help

Ruby on Rails: errors.add_to_base vs. errors.add

ruby-on-rails ruby validation model

I have read that errors.add_to_base should be used for errors associated with the object and not a specific attribute. I am having trouble conceptualizing what this means. Could someone provide an

Weird behaviour of HttpWebRequest while using WebProxy

c# proxy httpwebrequest httpwebresponse webproxy

I have an HttpWebRequest with a StreamReader that works very fine without using a WebProxy. When I use WebProxy, the StreamReader reads strange character instead of the actual html. Here is the cod...