Flash Multi Touch help
I am creating a Multi Touch game for a project of mine. I have created the desktop versionusing actionscript 3 and mouse clicks, but I need to convert it into multi touch. Below you will see the code for one of the levels.
Aims: The main game is a sniper based, you will have a completly blacked out screen with a cross hair only showing you a certain amount of the screen.
Solved problem: I have been able to convert my enemies to multi touch pretty easily with the touch begin events etc so they are not a problem
UnSolved problem: The code at the bottom in red is my issue, the creation of a pure black screen is fine I have that but to enable multi touch instead of a mouse is a little tricker. I can kill the enemy as I said above but I can't seem to get the correct command in to drag the "scope" around the screen.
IF anybody knows the code to put in it would be greatly appreciated or knows a tutorial that could help me out.
Thanks in advance,
Jason
stop();
Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;
var crosshairD:MovieClip; //this code replaces cursor with scope
var soundD:Sound = new Sound (new URLRequest("gunshot.mp3"));//this code calls in the mp3 file
mc_4.addEventListener(TouchEvent.TOUCH_BEGIN, dock_shot);
//stage.addChild(mc_4);
shootMe2();
function dock_shot(event:TouchEvent):void {
gotoAndStop(1, "level2_comp");
crosshairD.visible = false;
//Mouse.hide();
stage.removeChild(mc_4);
} //this code makes the movie clip clickable
guard1.addEventListener(TouchEvent.TOUCH_BEGIN, guard1_fcn);
//stage.addChild(mc_5);
function guard1_fcn(event:TouchEvent):void {
gotoAndStop(1, "level2_fail");
crosshairD.visible = false;
//Mouse.hide();
stage.removeChild(guard1);
} //this code makes the movie clip clickable
guard2.addEventListener(TouchEvent.TOUCH_BEGIN, guard2_fcn);
//stage.addChild(mc_5);
function guard2_fcn(event:TouchEvent):void {
gotoAndStop(1, "level2_fail");
crosshairD.visible = false;
//Mouse.hide();
stage.removeChild(guard2);
} //this code makes the movie clip clickable
guard3.addEventListener(TouchEvent.TOUCH_BEGIN, guard3_fcn);
//stage.addChild(mc_5);
function guard3_fcn(event:TouchEvent):void {
gotoAndStop(1, "level2_fail");
crosshairD.visible = false;
//Mouse.hide();
stage.removeChild(guard3);
} //this code makes the movie clip clickable
guard4.addEventListener(TouchEvent.TOUCH_BEGIN, guard4_fcn);
//stage.addChild(mc_5);
function guard4_fcn(event:TouchEvent):void {
gotoAndStop(1, "level2_fail");
crosshairD.visible = false;
//Mouse.hide();
stage.removeChild(guard4);
} //this code makes the movie clip clickable
function shootMe2 ():void
{
crosshairD = new Cursor();
stage.addChild (crosshairD);
crosshairD.enabled = false;
Mouse.hide();
crosshairD.mouseEnabled = false;
stage.addEventListener (MouseEvent.MOUSE_MOVE, dragCursorD);
stage.addEventListener (TouchEvent.TOUCH_BEGIN, clickedD);
}
function clickedD(event:TouchEvent):void{
soundD.play();
}
function dragCursorD (event:MouseEvent):void
{
crosshairD.x = this.mouseX;
crosshairD.y = this.mouseY;
}
