orientationChanged

Typemessage
DictionaryLCS
LibraryLiveCode Script
Syntax
orientationChanged
Summary

Sent to the current card of the defaultStack when the device detects a change in its position relative to the ground.

Introduced4.5.2
OSios, android
Platformsmobile
Example
on orientationChanged
   put mobileDeviceOrientation() into theOrientation
   updateInteface theOrientation
   -- update the interface to fit the new orientation
end orientationChanged
RelatedCommand: mobileSetAllowedOrientations, mobileLockOrientation, mobileUnlockOrientation, mobileSetFullScreenRectForOrientations
Function: mobileAllowedOrientations, mobileDeviceOrientation, mobileOrientation
Message: resizeStack
Description

Handle the orientationChanged message if you want to update the position of objects or perform other tasks when the orientation of the device changes.

The orientationChanged message is sent to the current card of the defaultStack when the device detects a change in its position relative to the ground. You can use the mobileDeviceOrientation function to find out the current orientation.

The orientationChanged message is sent before any automatic interface rotation takes place thus changes to the orientation lock state and allowed set can be made at this point and still have an effect. If you wish to perform an action after the interface has been rotated, then either do so on receipt of resizeStack, or by using a send|send in 0 milliseconds(command) command.