While the default accelerometer sensor update interval may be just fine for most applications, what if we would like to speed up or slow down this interval for a specific purpose?
We will need to change the accelerometer sensor update interval using methods included with the Accelerometer
class:
1. First, import the following classes into your project:
import flash.display.Sprite; import flash.display.Stage; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.events.AccelerometerEvent; import flash.events.TouchEvent; import flash.sensors.Accelerometer; import flash.text.TextField; import flash.text.TextFormat; import flash.ui.Multitouch; import flash.ui.MultitouchInputMode;
2. We'll now declare a number of objects to use in the example. First, a
TextField
andTextFormat
object pair to allow visible output upon the device, along with anAccelerometer
object.3. Then we will need to also employ...