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

What is Framer? Join the Community
Return to index
Jinglu Liu
Posted Jul 10 - Read on Facebook

Hi everyone, one basic question, how to change the state automatically instead of by touch or click event.

I usually change the state by using heart_no.states.next(), but it requires under the touch or click event. This is the example code,

heart_no.states.add
one: {scale: 1.5, opacity: 0}
two: {scale: 1, opacity: 0.5}
theree: {scale: 0.5, opacity: 1}

like_no.on Events.TouchStart, ->
heart_no.states.next()

Now, I want to change states without touch or click event, thx~~

7 Comments

Benjamin Den Boer

heart_no.states.switch("one") :-)

Anton Jarl

What should trigger the change? Should it be timed or what do you mean by 'automatic'?

Jinglu Liu

Anton Jarl the "automatic" means the the next state shows when the previous one has done

Jinglu Liu

Benjamin Den Boer I've tried this, but I want to show all states one by one without any operation like click or touch

Anton Jarl

And when is the last state 'done'? Is it when an animation is done, or something else?

Jinglu Liu

"done" means animation is done :)

Anton Jarl

Then use: like_no.on Events.AnimationEnd, ->

Read the entire post on Facebook