Dynamic Components OnClick Function Examples

OnClick Functions

Function Description Example(s)
ALERT("message") The ALERT function displays the value of the message in an alert box. Example:
  =ALERT("You Clicked Me!")
Displays an alert box with the phrase ""You Clicked Me!," when inside the ONCLICK attribute.

View SketchUp Example
ANIMATE(attribute, state1, state2, ... stateN) The ANIMATE function starts an animation that will change the value of the attribute to the next value in a list of parameters every half a second. For example,if the ONCLICK attribute contains ANIMATE("X",0,100), and the user clicks on the component, the component would animate the value of the "X" attribute between 0 and 100. A subsequent click would animate back to 0 from 100. If more than two animate states are passed, then the value will toggle between them in order. So, if the ONCLICK attribute equals ANIMATE("ROTZ",0,-130,10,100) the animation would go through each of the 4 values with each click.

This function animates with default easing. Easing is the speed of the animation (on a scale of 0 to 100, 0 being fastest). Easing is represented by two numbers, the first number (easein) identifies the speed at the start of the animation. The second number (easeout) identifies the speed at the end of the animation. Default easing is 0,100 (animation starts fast but slows down at the end).
View SketchUp Example
ANIMATESLOW(attribute, state1, state2, ... stateN) The ANIMATESLOW function does the same thing as animate, but slower (one second). View SketchUp Example
ANIMATEFAST(attribute, state1, state2, ... stateN) The ANIMATEFAST function does the same thing as animate, but faster (a quarter of a second). View SketchUp Example
ANIMATECUSTOM("attribute", time, easein, easeout, state1, ...stateN) The ANIMATECUSTOM function does the same thing as animate, but with over an arbitrary time with easing. Refer to the ANIMATE function for information about easing. View SketchUp Example
GOTOSCENE("sceneName," time, easein, easeout) The GOTOSCENE function moves to a scene identified by a name or number. Refer to the ANIMATE function for information about easing. View SketchUp Example
REDRAW() The REDRAW function redraws the component that contains this function. View SketchUp Example
SET("attribute", state1, state2, ...stateN) The SET functoin sets a given attribute to the next state in a list. View SketchUp Example
Was this article helpful?