By default you have already some functions in the ScriptEditor.
- function trigger(ob)
- function valueChange(ob, param)
- function eventEnter(area, ob)
- function eventLeave(area, ob)
These functions will be called, depending on the kind of trigger.
So a Button, Cue or other trigger events will always call the “trigger()” function.
A Slider, ColorField or the XYStick with the event “on change” will call the “valueChange()” function.
But on the other hand a slider trigger event “on reach end” will call the “trigger()” function.
From a Area you can call different functions depending on there task. “eventEnter()” and “eventLeave()” will be called from the areas events “On Enter” or “On Leave”.
All this functions gives you different objects back.
So the “trigger(ob)” gives you “ob” as variable.
This is the object what has run this script.
So if Button1 is the trigger the variable “ob” is equal the object Button1.
The valueChange(ob, param) function gives back:
- “ob” is equal the objects wich runs the script. (for example Slider1)
- “param” is the actual value from the “ob”.
The eventEnter and eventLeave gives back “area” and “ob”.
- “area” is the object (area) wich runs the script.
- “ob” is the actual object what has trigger this event.