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

What is Framer? Join the Community
Return to index
Alex Pereira
Posted Nov 19 - Read on Facebook

Hi folks, super noob here...brace yourselves.

I'm trying to add a global touch feedback animation to my prototype. I figured I could individually register all the layers to the touch event but I'm bummed at the amount of code this will add. Is there a better, more global way to achieve this without manually registering each layer?

5 Comments

Chris Camargo

"I figured I could individually register all the layers to the touch event but I'm bummed at the amount of code this will add. Is there a better, more global way..."

Without seeing the code you're thinking about, it's tough to make a call as to what is a "better, more global way". :)

Alex Pereira

Thanks for the tip Chris Camargo. I've mocked up an example of what I'm talking about here: http://share.framerjs.com/p0edmfv9l1aq/

As you can see, I've created a handler for all layers in order to have the touch feedback appear across the entire screen. This quickly becomes unwieldy as the complexity of my prototype increases...

Ideally I could create a single layer that spans the entire screen but this has the side effect of stealing touch events from all the underlying layers.

Any better ideas?

Chris Camargo
Alex Pereira

That works! Thanks Chris Camargo!!

Chris Camargo

No problem. Just keep in mind that function returns an array. You just need to loop over each layer in the array to do what ya'd like.

Read the entire post on Facebook