getButton(id).settings.callback( command )
or getButton(id).settings.callback( command1, command2 )
Will execute the command(s) whenever the button is clicked.
Example:
[js highlight=”5-9″ try=”true”]newVideo(“skate”, “skate.mp4”)
.print()
,
newButton(“(Re)play”)
.settings.callback(
getVideo(“skate”)
.stop()
.play()
)
.print()[/js]
Adds onto the page a video and a button which, whenever clicked, starts or restarts playing the video from the beginning.