Appearance
Events Overview
On this page you will find a full list of Stage Events accompanied by a brief explanation for each.
Important - Uncancelable
Any StageEvents
dispatched by Stage Instances running inside Web Workers are NOT cancelable.
Event Propagation Chain
All Stage Events (including derivations) are created and dispatched by a Stage Instance.
Each Stage Instance has a corresponding Display which re-dispatches all the Stage Instance's events via its DisplayController.
Finally the global Plinthos object re-dispatches all events from all Displays.
This means you can listen for Events on individual DisplayControllers to target specific Stage Instances, or you can listen for Events on the global Plinthos object and handle all events in a manner similar to event delegation.
Event Targets
You can attach events to:
The global
Plinthos
objectjsPlinthos.addEventListener('contentchange', event => { // All Content changes from all Stages will be caught here. // Differentiate between source Stages with event.stageKey. });
Display Controllers objects
jsPlinthos.displays.demo.addEventListener('contentchange', event => { // All Content changes from the Stage Instance with // the key "demo" will be caught here. });
Triggers
beforestart
StageEvent cancelablebeforestart
Dispatched when a Stage Instance has been instructed to start (usually via the Stage.start
function) but has not yet commenced the starting process.
If cancelled, the Stage Instance will not start.
starting
StageEventstarting
Dispatched when a Stage Instance has commenced the starting process.
This is different from start
in that at this point, the Stage has not yet started and several asynchronous tasks may need to take place before it does (i.e., loading the initial Content for the Stage Instance).
If no asynchronous tasks need to take place to start the stage, starting
and start
events will be dispatched synchronously.
start
StageEventstart
Dispatched when a Stage Instance has started and is currently rendering frames.
stopping
StageEventstopping
Dispatched when a Stage Instance has been instructed to stop.
This is different from stop
in that Stages inside the viewport usually stop a few seconds after they are instructed to stop so that their canvas element has time to fade out.
If the Stage Instance is not set to stop on a timer, the stopping
and stop
event will be dispatched synchronously.
stop
StageEventstop
Dispatched when a Stage Instance has stopped and is no longer rendering frames.
hover
StageHoverEventhover
Dispatched when mouse-responsive Motifs are hovered over or moused away from.
beforecontentchange
StageContentEvent cancelablebeforecontentchange
Dispatched when a Stage Instance has been instructed to change its Content but has not yet started the process of compiling the required Shot or loading its assets (if needed).
If canceled, the Stage Instance will not compile the Shot, load its assets or change Content.
beforecontentchange
will dispatch either a beforeshotchange
or beforesequencechange
event synchronously depending on the Content type.
contentchange
StageContentEventcontentchange
Dispatched when a Stage Instance changes its Content.
At the moment that event is dispatched, the Display will generally not reflect the new content because this event is dispatched when the Shot transition begins.
contentchange
will dispatch either a shotchange
or sequencechange
event synchronously depending on the Content type.
beforeshotchange
StageContentEvent cancelablebeforeshotchange
Dispatched when a Stage Instance has been instructed to change its Shot but has not yet started the process of compiling the Shot or loading its assets (if needed).
This is different from beforecontentchange
in that beforeshotchange
will also be dispatched when a Shot change is instigated by a Sequence.
If canceled, the Stage Instance will not compile the Shot, load its assets or change Content.
shotchange
StageContentEventshotchange
Dispatched when a Stage Instance changes its Shot (whether by direct instruction or as part of a Sequence).
At the moment that event is dispatched, the Display will generally not reflect the new Shot because this event is dispatched when the Shot transition begins.
beforesequencechange
StageContentEvent cancelablebeforesequencechange
Dispatched when a Stage Instance has been instructed to change its Content to a Sequence but has not yet started the process of compiling the required Shot or loading its assets (if needed).
If canceled, the Stage Instance will not compile the initial Shot, load its assets or set the Sequence.
sequencechange
StageContentEventsequencechange
Dispatched when a Stage Instance changes its Content to a Sequence.
At the moment that event is dispatched, the Display will generally not reflect the initial Shot because this event is dispatched when the Shot transition begins.
attributionchange
StageAttributionEventattributionchange
Dispatched when active attribution changes (i.e., when an licensed asset is is shown or hidden).
loadstart
StageContentEventloadstart
Dispatched when a Shot that has been instructed to show on a Stage Instance starts the process of compiling its final composition and loading any assets required in said composition.
loadend
StageContentEventloadend
Dispatched when a Shot finishes compiling and loading its required assets.
custom
StageCustomEventcustom
Dispatched as needed under customized circumstances on a per-Kit basis.