Action Scriptを使い、NORMALモードでのステージサイズを取得する場合、実機とFlash BuilderのAIRシミュレーターでは、設定により取得内容が異なります。AIRシミュレーターでは、デバイス設定に登録されている「使用可能な縦向きのサイズ」(ステージサイズ)を取得するには、FULL_SCREEN_INTERACTIVE の設定が必要のようです。
検証コード (AIRシミュレーター HTC Desire2)
//NORMAL のみを設定 stage.displayState = StageDisplayState.NORMAL; trace("stageWidth = " + stage.stageWidth); trace("stageHeight = " + stage.stageHeight); trace("fullScreenWidth = " + stage.fullScreenWidth); trace("fullScreenHeight = " + stage.fullScreenHeight);trace 結果
stageWidth = 500 stageHeight = 375 fullScreenWidth = 480 fullScreenHeight = 800
//FULL_SCREEN_INTERACTIVE を設定 stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE; stage.displayState = StageDisplayState.NORMAL; trace("stageWidth = " + stage.stageWidth); trace("stageHeight = " + stage.stageHeight); trace("fullScreenWidth = " + stage.fullScreenWidth); trace("fullScreenHeight = " + stage.fullScreenHeight);trace 結果
stageWidth = 480 stageHeight = 762 fullScreenWidth = 480 fullScreenHeight = 800