Skip to main content
Known Participant
June 25, 2015
Question

Adobe Air for IOS- issue in Orientaitation on ORIENTATION_CHANGING event

  • June 25, 2015
  • 1 reply
  • 341 views

I'm working on Adobe Air for IOS version..

Problem is that I not getting correct value of orientation while detecting ORIENTATION_CHANGING event.But Getting correct value only after ORIENTATION_CHANGE event

Here is the code,

import flash.events. StageOrientationEvent

stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGING,onOrientationChanging);

stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGE,onOrientationChange);

function onOrientationChanging(e:StageOrientationEvent):void

{

   trace(e.afterOrientation) /// not getting correct orientation value according to how we rotate device

}

function onOrientationChange(e:StageOrientationEvent):void

{

  trace(e.afterOrientation) /// getting correct orientation value according to how we rotate device

}

How can I get correct value while changing device orientation?

This topic has been closed for replies.

1 reply

funkysoul
Inspiring
June 25, 2015

Here a good article about it: Using screen orientation APIs for smartphone application development | Adobe Developer Connection

And if this fails, then here another post on these forums regarding some similar issues: StageOrientation without device auto-orientation