1
votes

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
Can't help you mate, but you could simply revert back. is there anything in 4.6 you need that 4.5 doesn't have? - Discipol
Thanks @Discipol, I need to use DateSpinner controls that are available on 4.6. and the most imp. is when I tried to upload release on itunesconnect it gives multiple error which are resolved on 4.6. - Arahim
so just add the swc that contains it and use it from there. - Discipol
I have used Event.Resize on stage. it resolved the issue. This event despatch after orientation event. and here are the stage width and height are correct. - Arahim
Thanks for your advices Disipol. - Arahim

2 Answers

0
votes

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

0
votes

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.