Actionscript 3 如何设置android的等效:screenOrientation=";“感觉景观”;在AdobeAIR for mobile中

Actionscript 3 如何设置android的等效:screenOrientation=";“感觉景观”;在AdobeAIR for mobile中,actionscript-3,air,flash-builder,Actionscript 3,Air,Flash Builder,我有一个AdobeAirActionScript手机项目。我想发布,使其行为类似于:sensor横向“横向定向,但可以是基于设备传感器的正常或反向横向。”-来自 我已设定: <initialWindow> <content>AppName.swf</content> <aspectRatio>landscape</aspectRatio> <autoOrients>true</autoOrien

我有一个AdobeAirActionScript手机项目。我想发布,使其行为类似于:sensor横向“横向定向,但可以是基于设备传感器的正常或反向横向。”-来自

我已设定:

<initialWindow>
    <content>AppName.swf</content>
    <aspectRatio>landscape</aspectRatio>
    <autoOrients>true</autoOrients>
<initialWindow>

AppName.swf
景观
真的
在App.xml中


结果是在Nexus 7上从FlashBuilder 7发布调试文件时,该文件始终是横向的,但它不会与设备重新定向以显示反向横向。

您没有给出任何代码,因此我认为您没有听:

stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGE, orientationChangeListener, false, 0, true);
//...
protected function orientationChangeListener(event:Event):void
    {
        /*
        log("beforeOrientation:" + event["beforeOrientation"].toString()
             + "\nafterOrientation:" + event["afterOrientation"].toString());
        */
    }
Android on orientation change会创建新的视图实例,AIR不会,所以您必须通过收听方向更改并相应地采取行动来编程,例如旋转视图(和调整大小等),同时检查舞台上的调整大小事件,因为它似乎对屏幕方向更改的响应更快

stage.addEventListener(Event.RESIZE, onStageResized, false, 0, true);
//...
protected function onStageResized(e:Event=null):void
{
    trace("sr.Orientation: " + stage.deviceOrientation);
}

致以最良好的祝愿

谢谢。我在听我的歌。事实证明,我的Android设备上没有设置自动旋转。我一打开它,它就开始工作了。然而,我相信在sensorLandscape中它确实有效。在Capture runtime AIR应用程序中,当全局自动旋转设置被锁定时,当我旋转设备时,它不会触发调整大小事件或方向更改事件。有人知道解决这个问题的方法吗?