Quantcast
Channel: Adobe Community : Unanswered Discussions - AIR Development
Viewing all articles
Browse latest Browse all 2010

Orientation change Android

$
0
0

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


Viewing all articles
Browse latest Browse all 2010

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>