Skip navigation
emiledodds
Currently Being Moderated

Orientation Problem is driving me bonkers (Android)

Jan 21, 2011 4:17 AM

This is my Flash for Android second app and I need to lock the orientation to landscape only.

 

When publishing via CS5, I set: Aspect Ratio: Fullscreen, Fullscreen: true, autoOrients: false - this shows up in the XML file and it works on the emulator, but not on the actual device (HTC Desire). As far as i can tell, this is what I need to do.

 

I can't figure out for the life of me why not. Could it be the stage size? I've set it to Width 800, height 480. I do *sometimes* get the error that the Air Debugger Launch program has stopped working. Could this be an issue?

 

Any help or pointers?

 
Replies
  • Currently Being Moderated
    Jan 24, 2011 6:07 AM   in reply to emiledodds

    Hi,

     

    Aspect Ratio: Fullscreen stands out for me as something that looks wrong from your description. It should be 'portrait' or 'landscape'. Or is that just an error in your post?

     

    Here's some settings I use to lock an App into portrait mode, which works on my HTC Desire:


        <transparent>false</transparent>
        <visible>true</visible>
        <fullScreen>true</fullScreen>
        <aspectRatio>portrait</aspectRatio>
        <autoOrients>false</autoOrients>

     

    It is a 480x800 fla.

     

    There's also an AIR actionscript 'Stage' property which sets orientation mode too. Maybe this would help? Although it should be redundant if you have set it up from the XML.

     

    If you get the debugger working, see what it traces out as the orientation, stage width and stage height. This would give us a clue as to what's happening.


    Nick

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 28, 2011 12:00 AM   in reply to emiledodds

    The AIR actionscript to set the stage orientation has been deprecated.

     

     

    This method hasn't been deprecated. Might be of use:

     

    this.stage.setAspectRatio(StageAspectRatio.LANDSCAPE);

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 3, 2011 9:35 AM   in reply to emiledodds

    Hmm, another user is having the same issue on HTC Desire:

    http://forums.adobe.com/thread/786606?tstart=0.  I posted a solution for her auto orient issue, but the landscape mode problem may be a problem with AIR on that particular device.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 3, 2011 1:56 PM   in reply to RossD20Studios

    I have posted a link to a test APK in that other thread, if you want to try?

     

    It is set to landscape, and starts up in landscape on my HTC Desire.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points