Flex: stage.stageHeight and stage.stageWidth are not correct on 4.6

682 Views Asked by At

I upgraded my project from 4.5 to 4.6.

            stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGE, onOrientationChangeHandler);

        protected function onOrientationChangeHandler(event:StageOrientationEvent):void

I am using orientation change events. on orintation change event I get the the stage.stageWidth and stage.stageHeight to make some change on application.

On sdk4.5 it give the correct width and height but when I upgraded on 4.6 it gives the last save values. for e.g if I move device from portrait to landscape it should give the new landscape width height but it gives the old portrait width height which makes problem on application...

Does anyone faces this issue.??

2

There are 2 best solutions below

0
On BEST ANSWER

I resolved the problem by using stage.addEventListener(Event.RESIZE, onStageResize);

0
On

You can try with systemManager Class. In AIR Mobile applications to get height and width of stage. Recommended way is you need to use systemManager.screen.width and systemManager.screen.height instead of stage.stageHeight and stage.stageWidth.