When developing projects which target the Android operating system, it is always a good idea to make sure that multitouch is actually supported on the device. In the case of an Android phone, this will probably always be the case, but what about a Google TV or AIR for TV device? Many of these are also Android-based yet most televisions do not have any touch control whatsoever. Never assume the capabilities of any device.
We will need to use internal classes to detect whether or not multitouch is supported:
1. First, import the following classes into your project:
import flash.display.StageScaleMode; import flash.display.StageAlign; import flash.display.Stage; import flash.display.Sprite; import flash.text.TextField; import flash.text.TextFormat; import flash.ui.Multitouch;
2. Declare a
TextField
andTextFormat
object to allow visible output upon the device:private var traceField:TextField; private var traceFormat:TextFormat...