3 Replies Latest reply on Jun 15, 2012 11:40 AM by jlehenbauer-m

    Bug(?) with StageOrientationEvent.ORIENTATION_CHANGE in air 3 .1.0.488 for android

    NilsTT Level 1



      In my app on a certain view, when the user rotates the device, the layout is dependent on the dimensions of the screen (in pixels).


      So what I do is listen for the StageOrientationEvent.ORIENTATION_CHANGE event and in the eventhandler I check the screen.height and screen.width property to layout my components


      Yesterday I discovered that this was running ok on my device but not on the device of one of my collegues. He was running the air 3.1 while I was on the 2.6 version. So I upgraded to 3.1 and have exactly the same problem as he has.


      After some investigation it turns out that the StageOrientationEvent.ORIENTATION_CHANGE event is fired ok but that the screen.heigt and screen.width properties are not yet updated (so if you go to portrait the width is the landscape width and the height is the landscape height).


      As a work around I think I should get the display dimensions on the view init and use the currentstate to determine wether the display is in landscape or portrait mode or is there a better solution