Adobe air 3.4 + auto orient
I'm having trouble with getting the app I'm creating (using Flash professional CS6) to auto orient reliably. if the app is moved from portrait to landscape, it works fine. when moved back from landscape to portrait, then the screen items do not move to the desired spots. within each of the "if" statements I also have commands for setting where screen items within the milApp movie clip are to appear. Any help is greatly appreciated.
//function to set the stage orientation for the app;
function orientMilApp(event:Event):void
{
var device_width:int = appStage.stageWidth;
var device_height:int = appStage.stageHeight;
if (device_width > device_height)
{
milApp.gotoAndStop("landscape");
//set the height, width, and position of the cheat sheet;
milApp.cheatSheet_mc.x = 0;
milApp.cheatSheet_mc.y = 100;
milApp.cheatSheet_mc.height = 1657.25;
milApp.cheatSheet_mc.width = 1280;
milApp.closeButton_btn.x = 1200;
milApp.closeButton_btn.y = 101;
//set the dimensions and position of screen items for the driver manual
//set the dimensions and position of screen items for the reference manual
} else {
milApp.gotoAndStop("portrait");
milApp.closeButton_btn.x = 720;
milApp.closeButton_btn.y = 101;
//set the height, width, and position of the cheat sheet;
milApp.cheatSheet_mc.x = 0;
milApp.cheatSheet_mc.y = 100;
milApp.cheatSheet_mc.width = 800;
milApp.cheatSheet_mc.height = 1035.80;
//set the dimensions and screen items of the driver manual
//set the dimensions and screen items of the reference manual
}
}
appStage.addEventListener (StageOrientationEvent.ORIENTATION_CHANGE, orientMilApp);
