Skip to main content
Known Participant
September 4, 2012
Question

Dealing with young children putting multiple fingers on screen

  • September 4, 2012
  • 2 replies
  • 483 views

I am making a simple drag and drop game for a very young audience for iPad only

In testing, I have noticed the kids often rest their thumb or other fingers on the screen whilst attempting to drag one of the draggable items. The placement of multiple fingers on the screen stops the dragging functionality from working.

I therefore would like to know how others deal with this. I am using Flash CS6 and Air 3.4.

My code that deals with the dragging and dropping is as follows:

<code>

function initDragger(mc:MovieClip):void

{

          mc.addEventListener(MouseEvent.MOUSE_DOWN, function (e:MouseEvent):void

          {

 

                    e.currentTarget.startDrag();

                    objGame.currentDraggingObject = e.currentTarget;

                    stage.addEventListener(MouseEvent.MOUSE_UP, dropObject);

 

 

 

          });

 

 

}

function dropObject(e:MouseEvent):void {

          objGame.currentDraggingObject.stopDrag();

          checkDropPosition(e.currentTarget);

});

</code>

This topic has been closed for replies.

2 replies

Colin Holgate
Inspiring
September 4, 2012

You can do your own thing with touch events, and looking at the ID of the events. But, is there any chance that you might end up using Starling? It combines mouse and touch events into one class, and with it you can either look for one touch or multiple touches. When a touch event happens you can ask whether the touch relates to a given object. That way the hand resting on the left or right of the screen ail be touches that don't relate to the draggable item, but there will be touch events going on that do relate to the draggable item.

The basics of regular touch events is that you get an ID for the touch, then you watch that particular ID in order to move the draggable object.

P StevenAuthor
Known Participant
September 4, 2012

Thanks again Colin. I have not had a look at Starling yet but it is on my list as I hear it can greatly improve performance. This particular game is very simple though the dragging and dropping can be a little bit laggy on the iPad still (iPad2).

Thank you for the heads up on the touch events basics - it sounds like this could enable me to allow the little ones to rest their fingers on the screen and the game still to work. I had already disabled Multitasking Gestures to prevent issues caused my lots of moving little fingers:)