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

What is Framer? Join the Community
Return to index
Ronald Ricket
Posted Oct 09 - Read on Facebook

hi. why doesn't the chaining example chain infinitely when pasted into the studio? it does one cycle then stops?

http://framerjs.com/learn/basics/events/

<>

# Layer with HTML
layerA = new Layer
x:0
y:0
backgroundColor:"#FFCCCC"
opacity:50

layerA.animate
properties:
x:200
curve: "ease-in-out"

layerA.on Events.AnimationEnd, ->
layerA.animate
properties:
x:100
curve: "ease-in-out"

4 Comments

Benjamin Den Boer

To loop single animations, try using the repeat property:

layerA.animate
properties:
x:200
curve: "ease"
repeat: 100

Benjamin Den Boer

The example loops because it is a .GIF file set to loop forever. :)

Ronald Ricket

ah thanks. i thought the call to 'layerA.animate' within the Event.animationEnd triggers a new animation, which itself would have an Event.animationEnd thereby looping forever?

Benjamin Den Boer

Ronald Ricket The new animation triggered by the animationEnd event does indeed also have its own animationEnd event, but it's not the same as the first animationEnd event. This means you can chain animations infinitely, and trigger different animations on each animationEnd event. To create simple loops, however, using the repeat property is easier.

Read the entire post on Facebook