Skip to content

Instantly share code, notes, and snippets.

@Draknek
Created April 25, 2012 01:10
Show Gist options
  • Save Draknek/2485191 to your computer and use it in GitHub Desktop.
Save Draknek/2485191 to your computer and use it in GitHub Desktop.
On init:
var startOrientation:String = FP.stage.orientation;
if (startOrientation == StageOrientation.DEFAULT || startOrientation == StageOrientation.UPSIDE_DOWN)
{
FP.stage.setOrientation(StageOrientation.ROTATED_RIGHT);
}
else
{
FP.stage.setOrientation(startOrientation);
}
FP.stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGING, orientationChangeListener);
...
private function orientationChangeListener(e:*): void
{
if (e.afterOrientation == "default" || e.afterOrientation == "upsideDown")
{
e.preventDefault();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment