Skip to main content
Inspiring
June 9, 2011
Answered

Can someone explain the different TouchEvents to me?

  • June 9, 2011
  • 2 replies
  • 1791 views

I looked through Adobe's documentation and googled this, but I guess it's something that's so easy no one has decided it's worth putting on the internet.

TOUCH_BEGIN, TOUCH_END, and TOUCH_MOVE are basically self explanatory, and I think I understand why you would want TOUCH_TAP in some places vs TOUCH_BEGIN + TOUCH_END in others, but these four really confuse me:

TOUCH_ROLL_OUT

TOUCH_OUT

TOUCH_ROLL_OVER

TOUCH_OVER


What are the differences between these? What types of events does each one listen for?

Thanks!

This topic has been closed for replies.
Correct answer kglad

the info is in the help docs but there's so much info there it's not always easy to find.

full explanations generally will be listed with the most basic class to implement the searched-for method, property or event.  in this situation, check under interactive object.  for example:

touchBegin

Event

Event Object Type: flash.events.TouchEvent

property TouchEvent.type  =  flash.events.TouchEvent.TOUCH_BEGIN

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10.1, AIR 2, Flash Lite 4

Dispatched when the user first contacts a touch-enabled device (such as touches a finger to a mobile phone or tablet with a touch screen). Some devices might also interpret this contact as a mouseDown event.

Specifically, if a user touches a finger to a touch screen, the InteractiveObject instance can dispatch a mouseDown event or a touchBegin event, or both if the current environment supports it. Choose how you want to handle the user interaction. Use the flash.ui.Multitouch class to manage touch event handling (enable touch gesture event handling, simple touch point event handling, or disable touch events so only mouse events are dispatched). If you choose to handle the mouseDown event, then the same event handler will run on a touch-enabled device and a mouse enabled device. However, if you choose to handle the touchBegin event, you can design your event handler to respond to the specific needs of a touch-enabled environment and provide users with a richer touch-enabled experience. You can also handle both events, separately, to provide a different response for a touch event than a mouse event.

Note: See the Multitouch class for environment compatibility information.

  Defines the value of the type property of a TOUCH_BEGIN touch event object. 

The dispatched TouchEvent object has the following properties:

etc

2 replies

Participating Frequently
May 3, 2013

I have this same question. I find it quite strange that we have to experiment to discover the details of these events. Isn't this the exact sort of information that should be included in the docs?

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
May 3, 2013

the info is in the help docs but there's so much info there it's not always easy to find.

full explanations generally will be listed with the most basic class to implement the searched-for method, property or event.  in this situation, check under interactive object.  for example:

touchBegin

Event

Event Object Type: flash.events.TouchEvent

property TouchEvent.type  =  flash.events.TouchEvent.TOUCH_BEGIN

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10.1, AIR 2, Flash Lite 4

Dispatched when the user first contacts a touch-enabled device (such as touches a finger to a mobile phone or tablet with a touch screen). Some devices might also interpret this contact as a mouseDown event.

Specifically, if a user touches a finger to a touch screen, the InteractiveObject instance can dispatch a mouseDown event or a touchBegin event, or both if the current environment supports it. Choose how you want to handle the user interaction. Use the flash.ui.Multitouch class to manage touch event handling (enable touch gesture event handling, simple touch point event handling, or disable touch events so only mouse events are dispatched). If you choose to handle the mouseDown event, then the same event handler will run on a touch-enabled device and a mouse enabled device. However, if you choose to handle the touchBegin event, you can design your event handler to respond to the specific needs of a touch-enabled environment and provide users with a richer touch-enabled experience. You can also handle both events, separately, to provide a different response for a touch event than a mouse event.

Note: See the Multitouch class for environment compatibility information.

  Defines the value of the type property of a TOUCH_BEGIN touch event object. 

The dispatched TouchEvent object has the following properties:

etc

Participating Frequently
May 5, 2013

Checking InteractiveObject was a good tip. I found what I was looking for there. It still seems odd that they wouldn't include more details or at least a link to InteractiveObject on the TouchEvent documentation. But at least it's there. Thanks kglad!

AmbariAuthor
Inspiring
June 10, 2011

Quick bump

kglad
Community Expert
Community Expert
June 10, 2011

assign different listener functions for each of those and experiment to see which actions result in which listener functions executing.  then report back your findings for others.

AmbariAuthor
Inspiring
June 10, 2011

When I get my provisioning license and can put code on an actual device, I will. Until then, I'm working with the emulator and a multi touch pad which is extremely awkward. I have to touch things three different times before they register to drag, so there would be no way for me to know if what I was doing was actually what you would be doing on the device.


That's a good idea, though, when I get a chance I will do that.