This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Juan Sanchez
Posted Oct 21 - Read on Facebook

I'm getting 'undefined' returned for event.x during a DragMove in this example when testing on my device:

Any ideas why? I was referring to this example for something I'm working on.


Tisho Georgiev

This happens, because on a touch event, the x/y could be different for the different fingers used. You can use this code to always use the location of the mouse when on desktop, and the location of the first touch on mobile:

myLayer.on 'DragMove', (event) ->
event = Events.touchEvent(event)
x = event.clientX
y = event.clientY

Juan Sanchez

Awesome. Thanks!

Read the entire post on Facebook