// Handle "flashend" event which logs to console when
// the flash has finished
inst.behaviors.Flash.addEventListener("flashend", e =>
{
console.log("Flash finished!");
});
// Start flashing with the Flash behavior for 2 seconds
inst.behaviors.Flash.flash(0.1, 0.1, 2);
Flash behavior events
See behavior instance event for standard behavior instance event object properties.
- "flashend"
- Fired when a flash finishes.
Flash behavior APIs
- flash(onTime, offTime, duration)
- Start flashing for the given
duration
with the object shown visible for the onTime
and invisible for the offTime
, with all times in seconds.
- stop()
- Stop any currently active flash effect, returning the object to a visible state.
- isFlashing
- A read-only boolean indicating if the object is currently flashing.