The Accelerometer object dispatches events based on activity detected by the device's motion sensor. This data represents the device's location or movement along a 3-dimensional axis. When the device moves, the sensor detects this movement and returns acceleration data. The Accelerometer object provides methods to query whether or not accelerometer is supported, and also to set the rate at which acceleration events are dispatched.

Note: Use the Accelerometer.isSupported property to test the runtime environment for the ability to use this feature. While the Accelerometer object and its members are accessible to the Runtime Versions listed for each API entry, the current environment for the runtime determines the availability of this feature. If Accelerometer.isSupported is true at runtime, then Accelerometer support currently exists.


Accelerometer object inherited from EventDispatcher


Can be created with method new:

Lib.Media.Sensors.Accelerometer.new()

Creates a new Accelerometer instance.



Accelerometer has properties:

isSupported

[static] [read-only] The isSupported property is set to true if the accelerometer sensor is available on the device, otherwise it is set to false.

muted

[read-only] Specifies whether the user has denied access to the accelerometer (true) or allowed access (false).


methods:

setRequestedUpdateInterval(interval)

The setRequestedUpdateInterval method is used to set the desired time interval for updates.

interval - The requested update interval. If interval is set to 0, then the minimum supported update interval is used.


Events: AccelerometerEvent

Created with the Personal Edition of HelpNDoc: Easily create EPub books