Highlighted

Orientation change Android

New Here ,
Aug 08, 2014

Copy link to clipboard

Copied

Hi, I have to say It's been a while i'm stuck on this problem and I'm about to disable orientation change for good.

This post is my bottle in the sea !

So I'll decribe my problem very shortly and clearly.

I'm building my first Android APP with Flash cs6 and Air for Android SDK V 13.0.0.111

My project properties (manifest) is set to Auto orientation, Auto Aspect Ratio.

I'm using the event to trigger my project adaptations --> StageOrientationEvent.ORIENTATION_CHANGE

When the stage flip, I gotoAndPlay("landscape or portrait") accordingly.

I've tried many codes on the web, but i'm always facing the same problem.

My event triggers just before the stage really flips. So I end up doing gotoAndPlay("landscape or portrait") before it is really required. But in the end in kinda works.
I think that using auto orientation will always leave my in that situation and I'm looking for your help.


Listen to this event to trigger my changeHandler function


mainC.racine.stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGE, changeHandler);


function changeHandler(e:StageOrientationEvent):void

  { 

       if(e.afterOrientation)

       {

             if(mainC.racine.stage.orientation == StageOrientation.DEFAULT)

            {
               mainC.racine.debug.text="landscape"; 
               mainC.racine.navA[currentView].gotoAndStop(2);

         

            }

            else if(mainC.racine.stage.orientation == StageOrientation.ROTATED_RIGHT ||  mainC.racine.stage.orientation == StageOrientation.ROTATED_LEFT)

            {

                 mainC.racine.debug.text="portrait";  

                mainC.racine.navA[currentView].gotoAndStop(1); 

            }  
      }  

  }

Thank you for considering helping me.

Sébastien

TOPICS
Development

Views

161

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Orientation change Android

New Here ,
Aug 08, 2014

Copy link to clipboard

Copied

Hi, I have to say It's been a while i'm stuck on this problem and I'm about to disable orientation change for good.

This post is my bottle in the sea !

So I'll decribe my problem very shortly and clearly.

I'm building my first Android APP with Flash cs6 and Air for Android SDK V 13.0.0.111

My project properties (manifest) is set to Auto orientation, Auto Aspect Ratio.

I'm using the event to trigger my project adaptations --> StageOrientationEvent.ORIENTATION_CHANGE

When the stage flip, I gotoAndPlay("landscape or portrait") accordingly.

I've tried many codes on the web, but i'm always facing the same problem.

My event triggers just before the stage really flips. So I end up doing gotoAndPlay("landscape or portrait") before it is really required. But in the end in kinda works.
I think that using auto orientation will always leave my in that situation and I'm looking for your help.


Listen to this event to trigger my changeHandler function


mainC.racine.stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGE, changeHandler);


function changeHandler(e:StageOrientationEvent):void

  { 

       if(e.afterOrientation)

       {

             if(mainC.racine.stage.orientation == StageOrientation.DEFAULT)

            {
               mainC.racine.debug.text="landscape"; 
               mainC.racine.navA[currentView].gotoAndStop(2);

         

            }

            else if(mainC.racine.stage.orientation == StageOrientation.ROTATED_RIGHT ||  mainC.racine.stage.orientation == StageOrientation.ROTATED_LEFT)

            {

                 mainC.racine.debug.text="portrait";  

                mainC.racine.navA[currentView].gotoAndStop(1); 

            }  
      }  

  }

Thank you for considering helping me.

Sébastien

TOPICS
Development

Views

162

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Aug 08, 2014 0

Have something to add?

Join the conversation