自从更新到 ios6,因此必须获得 beta AIR 3.5,它似乎是StageOrientationEvent
唯一触发upsideDown
和默认的,rotatedRight
不再是rotatedLeft
。我已经阅读了有关 ios6 中方向处理的更改,但我似乎无法为 AIR AS3 找到解决方法。这是我的快速定向测试应用程序的代码(只是在快速测试的时间线上):
stage.autoOrients = true
stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGE, orientationChange);
stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGING, orientationChanging);
function orientationChange(e:StageOrientationEvent):void{
var t:TraceOnStage = new TraceOnStage(stage ,"----------------");
t= new TraceOnStage(stage, "orientationChange before: " + e.beforeOrientation + stage.orientation);
t = new TraceOnStage(stage, "orientationChange after: " + e.afterOrientation + stage.orientation);
}
function orientationChanging(e:StageOrientationEvent):void{
var t:TraceOnStage = new TraceOnStage(stage ,"----------------");
t = new TraceOnStage(stage, "orientationChanging before: " + e.beforeOrientation + stage.orientation);
t = new TraceOnStage(stage, "orientationChanging after: " + e.afterOrientation + stage.orientation);
}
在 iPad 上它只跟踪颠倒和默认情况,它工作正常,直到 ios6。我有一系列需要定向的应用程序即将完成,客户正在等待然后这发生了!任何想法或帮助将不胜感激。