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

What is Framer? Join the Community
Return to index
Michał Sambora
Posted Apr 14 - Read on Facebook

I've run into some delay problems when I used states to swich image on Click, what is the best way to fix this? or maybe I Should use touchStart/End? source: (just wait a moment)
rotationZ: -45
scale: 1.2
image: "images/add2.png"

addd.states.animationOptions =
curve: "spring(500,20,5)"


Benjamin Den Boer

Hey Michał Sambora - ah. I the issue here is that "image" is not an animatable property. The easiest way would be to create two separate layers and crossfade them with opacity. You can also switch the images instantly on click (by simply overriding the image property like: layerA.image = "new.png") - but you can't "tween" between two images.

Michał Sambora

Benjamin Den Boer Could you assist me with some code here ? Still novice
I am sure that with touchStart / End events I can easily switch those images but then I have problems with Z rotation. It rotates 40* once and stops at such position. Is there a way to make it go back with another Touch ?

Benjamin Den Boer

Heya Michał Sambora - ofcourse. Feel free to also personally message me on here if you need help in the future. Hmm, I'm not sure what you're trying to do exactly - could you send me the full example (with the snippet above included?) It may be that you're not also setting the rotationZ on TouchStart, but only on TouchEnd.

Michał Sambora

Benjamin Den Boer thanks! Just have sent you PM

Read the entire post on Facebook