• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Orientation Problem is driving me bonkers (Android)

New Here ,
Jan 21, 2011 Jan 21, 2011

Copy link to clipboard

Copied

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?

TOPICS
Development

Views

2.9K

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
community guidelines
Participant ,
Jan 24, 2011 Jan 24, 2011

Copy link to clipboard

Copied

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

Votes

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
community guidelines
New Here ,
Jan 27, 2011 Jan 27, 2011

Copy link to clipboard

Copied

Hi Nick,

Sorry, I must have been tired when I typed that. Yes, I have the same XML code as you except with landscape instead of portrait in the AspectRatio tag. The tags are generated by CS5 automatically.

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

No, I haven't tried the debugger - I'll do that and see. As far as I can tell, I'm doing everything right, though, which means it could be a bug in AIR except if so I should have heard about others with the same problem.

Votes

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
community guidelines
Participant ,
Jan 28, 2011 Jan 28, 2011

Copy link to clipboard

Copied

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);

Votes

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
community guidelines
New Here ,
Jan 28, 2011 Jan 28, 2011

Copy link to clipboard

Copied

OK, that looks really helpful. I will try this out and post the results later.

Thanks.

Votes

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
community guidelines
Explorer ,
Feb 03, 2011 Feb 03, 2011

Copy link to clipboard

Copied

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.

Votes

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
community guidelines
Participant ,
Feb 03, 2011 Feb 03, 2011

Copy link to clipboard

Copied

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.

Votes

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
community guidelines
New Here ,
Feb 23, 2011 Feb 23, 2011

Copy link to clipboard

Copied

LATEST

OK fixed it.

If anyone else is having this problem, here's what happened.

Before you can publish to Android with Flash, you need to download an extension, and I was still using the pre-release extension. The pre-release extension worked perfectly except for the orientation problem.

The extension I was using was: AIRforAndroid_FlashCS5_070510.zxp

and I replaced it with flashpro_extensionforair_p2_112210.zxp

Votes

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
community guidelines