Skip to main content
Inspiring
September 16, 2013
Question

[Solved] Need help with stopTouchDrag

  • September 16, 2013
  • 0 replies
  • 286 views

Worked fine when I added this

var joystick_touchPointID:Number;

joystick_touchPointID=touchPointID;

object_joystick.stopTouchDrag(joystick_touchPointID);

-------------------------------------------------------------------------------------------------------------------------------

Hi,

In my game I have a joystick (Flash Pro, Air 3.9 beta, iPad mini):

--------------------

object_joystick.addEventListener(TouchEvent.TOUCH_END, f_joystick_hat_end);
object_joystick.addEventListener(TouchEvent.TOUCH_BEGIN, f_joystick_hat_begin);

function f_joystick_hat_begin(event:TouchEvent):void
{

event.target.startTouchDrag(event.touchPointID, true);
}

function f_joystick_hat_end(event:TouchEvent):void
{

event.target.stopTouchDrag(event.touchPointID);

}

--------------------

And it works pretty good. Sometimes I need to stop the joystick/drag (on some game levels/ iff game-settings is pressed etc.). Is there a way to call the stopTouchDrag while the player still is on touch_begin with the finger? Cause it might happen that the player doesn't remove the finger before pressing menu-settings etc. and then the joystick will be in the background causing problems.

Commands like: menu_settings.addEventListener(TouchEvent.TOUCH_TAP, f_joystick_hat_end);   didn't work.

thanks,

Grey

This topic has been closed for replies.