Skip to content

emit(...)

Studio is being deprecated, please head over to the documentation page for Mattercraft, our most advanced 3D tool for the web, where you can find the most recent information and tutorials.

emit(evt : string, ...params : any[]) : this;

Calls the handler functions attached to an event.

ParameterTypeDescription
evtstringThe name of the event.
paramsfunctionA variable-length list of parameters to pass to handler functions.

this

myobject.on("customEvent", myHandler);
function myHandler(customParam : number) {
// This function is executed when emit is called below
// customParam has the value 5 in this instance
}
myobject.emit("customEvent", 5);