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.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
evt | string | The name of the event. |
params | function | A variable-length list of parameters to pass to handler functions. |
Returns
Section titled “Returns”this
Example
Section titled “Example”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);