A variety of input types are available across Android devices and depending upon the project we are working on, we may need to verify that any particular device supports the intended modes of user interaction. Fortunately, there are a number of ActionScript classes to assist us in discovering device capabilities in regard to user input.
We will need to use internal classes to detect whether or not multitouch is supported:
1. First, import the following classes into your project in order to check various input types across devices:
import flash.display.Sprite; import flash.display.Stage; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.system.Capabilities; import flash.system.TouchscreenType; import flash.text.TextField; import flash.text.TextFormat; import flash.ui.Keyboard; import flash.ui.KeyboardType; import flash.ui.Mouse;
2. Declare a
TextField
andTextFormat
object to allow visible output upon the...