2

I am actually not getting the difference between MouseEvent.Click event and TouchEvent.Touch"event in action script.

Both are giving same output in touch based system.

I wanted to know that how they differ in processing user events.

Nope
  • 22,147
  • 7
  • 47
  • 72

1 Answers1

8

Technical: On a touchscreen, TouchEvent is used for handling actions that require more than one finger being pressed on the display simultaneously. MouseEvent is used for handling actions that require only one finger.

Processor: TouchEvent is more processor-intensive than MouseEvent.

So you should use MouseEvent for single-touch actions and use TouchEvent (or GestureEvent) for multitouch actions.

T Graham
  • 1,329
  • 10
  • 14
  • 1
    Note that you can, in fact, use `TouchEvent` to register a single touch, but as stated, it is more consuming than a simple `MouseEvent`. (+1 because your answer is damn simple and effective) – NemoStein Jan 26 '13 at 17:36
  • 1
    Good answer, also to add, if you want to get "pressure" information or stylus information (so far haven't seen this myself but imagine it works for the Note and other devices with an "active" stylus) then you have to use the TouchEvent. Handling multitouch manually is the main advantage I see with using it over mouse events, each TouchEvent has a touchPointID so you can tell if the same finger came down went in motion then came up. For multi-touch that just requires the basic gestures GestureEvents will work. – shaunhusain Jan 27 '13 at 00:19
  • I want to know that even if TouchEvent is processor intensive, starling framework is using TouchEvent instead MouseEvent. So what should be the reason for using TouchEvent. As we know starling framework is now a days boosting for touch application and angrybird is also using starling framework. – Ankit N. Patel Jan 27 '13 at 05:25
  • Thank you, Nemo and Shaun. Ankit, Starling has its own set of classes for handling mouse/touch actions (starling.events.Touch and starling.events.TouchEvent). Starling doesn't have a separate MouseEvent class. I agree, all of this can be confusing. If you haven't already done so, you might want to take a look at O'Reilly's free Starling book: http://shop.oreilly.com/product/0636920024217.do. – T Graham Jan 28 '13 at 01:34
  • Thank you all, this is really very helpful to me. From this I got much knowledge about the difference. – Ankit N. Patel Feb 02 '13 at 10:35