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

What is Framer? Join the Community
Return to index
Junhyuk Jang
Posted Jun 30 - Read on Facebook

Hi guys, happy new year~

Question:
I want to show 'touch point' when record my prototype.
So I made some trick.
It works well on background, but doesn't work on layer..

How can I fix it??
Here's my code.

# set stage
bg = new BackgroundLayer

# touch layer
o = new Layer
width:100, height:100, backgroundColor:'#2dd7aa'
o.borderRadius = 100
o.opacity = 0

# set touch effect
Framer.Device.screen.on Events.TouchStart, (e) ->
o.bringToFront()
o.animate
properties:
midX:e.offsetX
midY:e.offsetY
scale:3
opacity:0.5
time:0.01
Utils.delay 0.1, ->
o.animate
properties:
scale:1
opacity:0

a = new Layer
width:300, height:300, backgroundColor:'#28affa'
a.center()

a.states.add
second: {rotation:45}
third: {rotation:0}

a.states.animationOptions =
curve:'spring(200,20,0)'
time:0.2

a.on Events.Click, ->
a.states.next()

2 Comments

Seoh Char

Simple workaround is here. This problem is about event bubbling. I have no idea about a way to handle events in Framer internally, I cannot say exactly how to handle propagated event. but If you have front-end(web) development experience, I think you may handle that.

Jordan Robert Dobson

Here's some code that should do what you want: http://jrdn.io/gb6o

Read the entire post on Facebook