import flash.events.TouchEvent;
import flash.events.MouseEvent;
import flash.ui.Multitouch;
import flash.ui.MultitouchInputMode;
import flash.display.Sprite;
Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;
var text1:String;
var text2:String;
var text3:String;
var touchtotal:int = 0;
var touchMoveID:int = 0;
var touchgrouplength:int;
var touchgroup:Array = new Array();
var ballgroup:Array = new Array();
var myline1:Sprite = new Sprite();
var tempballnum:int;
var tempflagx:Boolean;
var tempflagy:Boolean;
var tempflag:Boolean;
var color:uint = rgb();
if (Multitouch.supportedGestures)
{
text1 = "● SupportsGesture, Support " + Multitouch.maxTouchPoints.toString() + " MaxTouchPoint ";
}
else
{
text1 = "● No supports Gesture ";
}
if (Multitouch.supportsGestureEvents)
{
text2 = "SupportsGestureEvents ";
}
else
{
text2 = "No supports GestureEvents ";
}
if (Multitouch.supportsTouchEvents)
{
text3 = "SupportsTouchEvents";
}
else
{
text3 = "No supports TouchEvents";
}
mytext1.text = text1 + text2 + text3;
startbutton.addEventListener(TouchEvent.TOUCH_TAP, taphandler);
function taphandler(evt:TouchEvent):void
{
removeChild(startbutton);
removeChild(group1);
removeChild(group2);
stage.addEventListener(TouchEvent.TOUCH_BEGIN, onTouchBegin);
stage.addEventListener(TouchEvent.TOUCH_MOVE, onTouchMove);
stage.addEventListener(TouchEvent.TOUCH_END, onTouchEnd);
}
function onTouchBegin(eBegin:TouchEvent)
{
touchtotal = touchtotal + 1;
mytext2.text = "● You have touched " + touchtotal + "points";
touchMoveID = eBegin.touchPointID;
tempflagy = (eBegin.stageY > touchbox.y) && (eBegin.stageY < (touchbox.y + touchbox.height));