• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

[MOBILE AIR] touchPointID does not work on device

New Here ,
Feb 27, 2014 Feb 27, 2014

Copy link to clipboard

Copied

    import flash.events.TouchEvent;

    import flash.ui.Multitouch;

    import flash.ui.MultitouchInputMode;

   

    Multitouch.inputMode=MultitouchInputMode.TOUCH_POINT;

   

    stage.addEventListener(TouchEvent.TOUCH_BEGIN, mDown);

   

    function mDown(e:TouchEvent):void

    {

              debugText.text = "TOUCH ID " + String(e.touchPointID);

   

    }

This code on desktop works as expected (IDs are incrementing), but when I publish the app to my device (Lenovo IdeaTab A1000) it works like touch counter -1. (One finger = 0, two fingers 1 and so on....)

Does anyone know what to do with it?

Thank you

TOPICS
ActionScript

Views

1.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 27, 2014 Feb 27, 2014

Copy link to clipboard

Copied

you only need to use touchPointID when handling touchbegin, touchend etc events and you need to check which touchpoint is triggering the touchbegin and touchend events.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 28, 2014 Feb 28, 2014

Copy link to clipboard

Copied

Yes, that's what I am trying to do. But how can I do it if it does not track ID properly?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 28, 2014 Feb 28, 2014

Copy link to clipboard

Copied

what makes you think it's not tracking properly?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 28, 2014 Feb 28, 2014

Copy link to clipboard

Copied

Well because:

1) it works different in desktop simulation and on android device

2) every post on internet so far mentions that touchPointID is uniquie identifier - which is not

I am not sure you understand my question so I will put here some examples:

Example a)---------------------------------------------------

Desktop simulation:

10x tap with one finger - text field says "TOUCH ID 10"

Android device:

10x tap with one finger - text field says "TOUCH ID 0"

Example b)---------------------------------------------------

Desktop simulation:

Tap and hold with first finger, tap and hold with second finger - text field says "TOUCH ID 2"

>> Release both fingers >> tap with one finger -  text field says "TOUCH ID 3"

Android device:

Tap and hold with first finger, tap and hold with second finger - text field says "TOUCH ID 1"

>> Release both fingers >> tap with one finger -  text field says "TOUCH ID 0"

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 28, 2014 Feb 28, 2014

Copy link to clipboard

Copied

so?

do you see any problem with a touchbegin and touchend being confounded so the wrong object is associated with a touchend?

or what is the issue?  are you trying to display a counter in a textfield that displays the number of times the screen is touched?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 28, 2014 Feb 28, 2014

Copy link to clipboard

Copied

Well I was trying to fix the bug, if there is any.

I can adjust the script to this behavior and simply ignore desktop simulation if this is how it should work.

Thanks!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 28, 2014 Feb 28, 2014

Copy link to clipboard

Copied

i don't see a problem.  there's no need to use touchpointID unless you're using multitouch touchbegin/touchend events and you need to know which touchend goes with which touchbegin.  in that situation i see no problem resetting all touchpoint ids when all touchend events have been dispatched.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 28, 2014 Feb 28, 2014

Copy link to clipboard

Copied

I do use multitouch and I need to know which touch end when. This code is just a simple demonstration.

I will just go with it as a dogma - on desktop it's incrementing with every touch, on android it's unique identifier just for currently active touches.

I know how to remake that code to fit my needs (and ignoring desktop simulation). It just felt wierd that it acts differently on Android and I want to know why.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 28, 2014 Feb 28, 2014

Copy link to clipboard

Copied

i don't know why it acts differently in your different test scenarios.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 19, 2014 Dec 19, 2014

Copy link to clipboard

Copied

LATEST

I am experiencing this as well, and it's incredibly frustrating. It's breaking my project.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines