With Flash on Android, we have the ability to invoke the native Android SMS utility through classes in the flash.net
package based upon user interaction. We do not have the ability to supply any content for the text message, unfortunately. On Android, since all applications take up a full window, we must be extra mindful of any disruption this may cause while the user is interacting with our application.
Having the application invoke navigateToURL
and passing in a new URLRequest
with the correct URI prefix of sms:
will open the default SMS utility along with the specified phone number loaded up, ready to text. In this example, we will perform this action once a TOUCH_TAP
event is detected:
1. First, import the following classes into your project:
import flash.display.Sprite; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.events.TouchEvent; import flash.text.TextField; import flash.text.TextFormat...