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

What is Framer? Join the Community
Return to index
Shane Brown
Posted Apr 07 - Read on Facebook

I'm having a ton of trouble trying to get a hold and select working (similar to the Apple iMessage hold and move to capture sound / video).

I don't know how, after getting the touchStart on the main object, that I can then detect movement over another object properly. I've done a bit of searching on here but haven't been able to get anything working =/

It feels like it should be pretty simple, and some suggestions seemed to revolve using javascript and the dom directly (elementFromPoint). I'm not sure how to set id's via Framer to do that, or how to accurately detect touch/mouse location within the device itself.

very simple Framer Project here
http://share.framerjs.com/ts045uui01s2/

4 Comments

Shane Brown

bump.. still looking for help on this :)

Jordan Robert Dobson

So. Essentially you need to take the pointer position and see if that position (x,y) is inside the other one.

Shane Brown

To clarify, I guess what I'm really interested in is understanding how I can integrate normal JS while working with Framer.

For example, I am used to relying on the Touch events, but in what I was trying to do, a touchStart / touchEnd event doesn't trigger when moving over a layer while already touching, and touchMove would trigger in, but not out.

Searching on here, I came across references to doing it in normal javascript which seemed simple, but I don't know how to, for instance, set the id or class of the layer to access it via JS. And then I was also confused by how to access the touch values relative to just the device screen, rather than the entire browser.

Shane Brown

I do have the example working now though via the Framer.Device.screen object and detecting all TouchMovement to work it out to quadrants around the button.

Read the entire post on Facebook