hi. why doesn't the chaining example chain infinitely when pasted into the studio? it does one cycle then stops?
# Layer with HTMLlayerA = 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"
To loop single animations, try using the repeat property:
layerA.animate properties: x:200 curve: "ease" repeat: 100
The example loops because it is a .GIF file set to loop forever. :)
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?
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.