FiniteTimeAction.getDuration problem

Hello! Im trying to get the time taken to perform a swipe gesture so I can do move a sprite depending on that time. However I can’t get the time with finite time action.

I do: var time = cc.FiniteTimeAction.getDuration();
Im not sure where to call this, but after having a look at the docs i put it in the onTouchesEnded function of my touch event handler. But console is saying cc.FiniteTimeAction.getDuration() is undefined.

Please help me! Thanks

Hi @Drunk3n1 ,

If you want to find the time difference between TouchBegun & TouchEnd,
You can do by getting System time : var begin = new Date().getTime();
You can even start Update function to keep track of count in TouchBegun & Stop Update function in TouchEnd

Regards,
Gurudath

1 Like

Thanks so much :slight_smile: