Skip to content

Latest commit

 

History

History
22 lines (18 loc) · 715 Bytes

File metadata and controls

22 lines (18 loc) · 715 Bytes

Examples

Play a sound block when an action is triggered by a button panel.

Youtube Video

  • Setup a sound block named "Sound Block" with settings to play an alarm.
  • Put the following script in a Javascript Programmable Block and reset it.
function playSound()
{
  var soundBlock = Blocks.get("Sound Block");
  if(soundBlock === null)
    console.log("Sound block not found");
  else
    soundBlock.applyAction("PlaySound");
}

Event.onAction("TriggerAlarm", playSound);
  • Add the "TriggerAlarm" action to a button panel by dragging the Javascript Programmable Block to a button.
  • Press button.