Events
Events are named signals (a message your animation sends out at a specific moment) that fire from your Rive scene. A timeline can fire an event at a specific frame, a state machine can fire one on entering or leaving a state, and runtime code can listen for them.
Use Events to:
- Trigger sound effects or haptics from an animation frame
- Open a URL when a user taps a button animation
- Notify your app that an animation has reached a specific point
Event Types
| Type | Description |
|---|---|
| Open URL | Opens a web address. Configure the URL and whether it opens in the same tab or a new one. |
| Audio | Triggers an audio file. Requires an imported audio asset. |
| General | A generic signal with a custom name. Use for notifying runtime code. |
Older Rive documentation may mention a deprecated "General Event" system. The current approach uses named General events (as described on this page). You can safely ignore any references to the old system.
Creating an Event
Select the Events tool from the Toolbar and click the artboard. The Events panel appears in the Inspector.
Type a name in the Name field, or double-click the event on the artboard to rename it.
Select Open URL, Audio, or General from the type dropdown.
For Open URL: set the URL and tab target. For Audio: choose the audio asset and set volume. General events have no extra configuration.
Signaling Events
An event does nothing until something fires it. You can signal an event from four places.
From a Timeline
In Animate mode, select the animation. Click Report Event in the Timeline controls, then drag the marker to the frame where the event should fire.
From a State
Select a state node in the State Machine Graph. In the Inspector, click + next to Events and choose when to fire: Start or End of the state.
From a Transition
Select a transition arrow. In the Inspector, click + next to Events to fire the event when the transition begins.
From a Listener
In a Listener's Action, choose Report Event and select the event to fire when the Listener condition is met.
Receiving Events at Runtime
A developer can listen for events in code. When the Rive scene fires an event, it sends the event name and any attached data to a listener function (a function that runs automatically when something happens) in the app.
Full API reference for Open URL, Audio, and General events.
Fire events from user interactions using Listeners.