知道为什么我的代码无法在 iPad3 iOS6 上运行,还是 Adobe air 的错误?
以下代码适用于 iOS5 的 iPad1 和 iPad2
if (startOrientation == StageOrientation.DEFAULT || startOrientation == StageOrientation.UPSIDE_DOWN){
stage.setOrientation(StageOrientation.ROTATED_RIGHT);}
else{
stage.setOrientation(startOrientation);
}
stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGING, orientationChangeListener);
private function orientationChangeListener(e:StageOrientationEvent):void{
txt_rotate.text = 'Camed' + StageOrientation.ROTATED_LEFT;
if (e.afterOrientation == StageOrientation.DEFAULT || e.afterOrientation == StageOrientation.UPSIDE_DOWN){
e.preventDefault();
}else if(e.afterOrientation == StageOrientation.ROTATED_LEFT){
_stageOrientation = 'ROTATED_LEFT';
txt_rotate.text = _stageOrientation;
}else if(e.afterOrientation == StageOrientation.ROTATED_RIGHT){
_stageOrientation = 'ROTATED_RIGHT';
txt_rotate.text = _stageOrientation;
}
}