Skip to main content
mercedesc43970157
Participating Frequently
June 27, 2017
Answered

Change a movie clip when is touched (not clicked)

  • June 27, 2017
  • 1 reply
  • 525 views

Hi,

I'm working with animate cc html5 canvas.

My problem is that I would like to change a movie clip color when is touched, but with a code that works with both the mouse and on touch devices.

I do not use the "click" event because I need the MC to change when it is touched (for example if the finger clicked on another side on the screen but is swiping and passes over the MC)

I already saw that "mouseover" does not work on touch devices.

I also tried with HitTest (making an MC replace the mouse and putting the code there), but it does not help because I see that there is a delay in the speed in which an MC follows the cursor in the touch devices.

Hopes someone can help!

This topic has been closed for replies.
Correct answer kglad

if you want to include all the different ways a mouse or finger can 'touch' a movieclip, i don't see any other way other than a hittest.

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
June 27, 2017

if you want to include all the different ways a mouse or finger can 'touch' a movieclip, i don't see any other way other than a hittest.

mercedesc43970157
Participating Frequently
June 27, 2017

Ok thanks.

mercedesc43970157
Participating Frequently
June 28, 2017

you're welcome.


Could you tell me if you know any way to optimize how an MC follows the mouse?

Works perfect on desktop but I've tested on several touchscreen devices and there is al lag that makes this solution (HitTest) not effective.

Does a rectangle movie clip following the mouse consume so many device resources ?


Note: if I upload the fps to 120, this solution works on desktop and mobile, but it is not the idea since the animations start working differently.