The Accelerometer class dispatches AccelerometerEvent objects when acceleration updates are obtained from the Accelerometer sensor installed on the device.
Constructor
new (type:String, bubbles:Bool = false, cancelable:Bool = false, timestamp:Float = 0, accelerationX:Float = 0, accelerationY:Float = 0, accelerationZ:Float = 0)
Creates an AccelerometerEvent object that contains information about acceleration along three dimensional axis. Event objects are passed as parameters to event listeners.
Parameters:
type | The type of the event. Event listeners can access
this information through the inherited
|
---|---|
bubbles | Determines whether the Event object bubbles. Event
listeners can access this information through the
inherited |
cancelable | Determines whether the Event object can be canceled.
Event listeners can access this information through
the inherited |
timestamp | The timestamp of the Accelerometer update. |
accelerationX | The acceleration value in Gs(9.8m/sec/sec) along the x-axis. |
accelerationY | The acceleration value in Gs(9.8m/sec/sec) along the y-axis. |
accelerationZ | The acceleration value in Gs(9.8m/sec/sec) along the z-axis. |
Variables
Acceleration along the x-axis, measured in Gs.(1 G is roughly 9.8 m/sec/sec.) The x-axis runs from the left to the right of the device when it is in the upright position. The acceleration is positive if the device moves towards the right.
Acceleration along the y-axis, measured in Gs.(1 G is roughly 9.8 m/sec/sec.). The y-axis runs from the bottom to the top of the device when it is in the upright position. The acceleration is positive if the device moves up relative to this axis.
Static variables
staticinline read onlyUPDATE:String = "update"
Defines the value of the type
property of a
AccelerometerEvent
event object.
This event has the following properties: