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?
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
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.
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);
Copy link to clipboard
Copied
OK, that looks really helpful. I will try this out and post the results later.
Thanks.
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.
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.
Copy link to clipboard
Copied
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