Yes, there are even more events to tap into. With a ‘change’ event can listen to the changes of any property.
And when you’re animating that property you will get 🔃 continuous updates of the changes. (list of animatable properties in Animation)
For example, if you were to listen to a layer’s
# print the rotation value layer.on "change:rotation", -> print this.rotation
…you would see a stream of values appear in the Console when a rotation animation is running.
Note that for all the other events we’ve been using shortcuts.
Is short for this:
layerA.on Events.Tap, ->
Change events don’t have shortcuts, so you must always write the
, before the
Below are some change events that you might not have thought of.
You can look at the position or size of a layer, or both at the same time:
|New x or y position|
|New width or height values|
|New x, y, width or height values|
You can also track when the HTML or style of a layer changed, when a child is added or removed from its parent, or when a layer becomes or ceases to be the parent of another layer. And there’s an event specifically for PageComponents.
|New style declaration|
|New html declaration|
|Text content of a Text Layer changed|
|Added or removed child layers|
|The layer is added to or removed from a parent layer|
|The PageComponent snapped to a page|