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: http://share.framerjs.com/lq5681krkz5v/ (just wait a moment)
addd.states.add
one:
rotationZ: -45
scale: 1.2
image: "images/add2.png"

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

4 Comments

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 ? https://www.dropbox.com/s/6925gmk68gc3l06/Zrzut%20ekranu%202015-04-14%2010.06.36.png?dl=0

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