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

What is Framer? Join the Community
Return to index
Tyrale Bloomfield
Posted Aug 01 - Read on Facebook

Can you trigger an animation at the end of a state? For example after "stateB" runs I want to run an extra animation. But not following "stateA" or "stateC".

Basically I want .on 'end', to work with states.

Thanks.

5 Comments

Aaron Carámbula

There is a undocumented event triggered before switch and after. Poke around the the github repo in the states file. Something like statedidchange

Tyrale Bloomfield

Thanks, I will look.

Tyrale Bloomfield

I think I am too fresh to CoffeeScript to get what is going on here. I did find something here: https://github.com/koenbok/Framer/blob/master/framer/LayerStates.coffee

Aaron Carámbula

Yup that's it, nice find! So you can do (I think, I'm on mobile so some stuff may be off…)
myLayer.on Events.StateDidSwitch, ->
#…some stuff to do after it switches

It may be myLayer.states.on I can't remember

Tyrale Bloomfield

Nice. It's myLayer.states.on Thanks for help with the syntax

Read the entire post on Facebook