title: "onEvent()" is not being triggered by click
body: <p>I am using the <a href="https://code.org/educate/applab" rel="nofollow noreferrer">App Lab bu code.org</a> which  allows me to make an "app" using blocks or their JavaScript equivalent. In this app, I am applying the kinematic equations as seen in this chart:</p>
  
  <p><a href="https://i.stack.imgur.com/40oNZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/40oNZ.png" alt="enter image description here"></a></p>
  
  <p>My program calculates the maximum height and the horizontal velocity based the user input for time, <code>r</code> or the horizontal range, and the launch angle (which currently is not used). To do so, it manipulates the first of four equations to:</p>
  
  <pre><code>v_x = (x - x_0) / t
  </code></pre>
  
  <p>or put simply, the horizontal velocity is the total distance traveled horizontally minus the initial horizontal velocity (which is always 0) divided by the time. For the height, it simply uses the second equation. Code:</p>
  
  <pre><code>var time = 1;
  var range = 1;
  var angle = 0;
  
  var GRAVITY = -32.2;
  var v_yo = 0;
  var y_o = 0;
  
  setText("time", time);
  setText("x_range", range);
  setText("launch", angle);
  
  function horizontal_velocity() {
    var v_x = ((range - 0)/time * 3600)/5280;
    setText("text_area1", v_x.toFixed(5));
  }
  
  function maximum_height() {
    var height = 0.5 * GRAVITY * Math.pow(time/2, 2) + (v_yo * (time/2)) + y_o;
    setText("text_area2", height.toFixed(5));
  }
  onEvent("timey", "click", function(event) {
    setText("time", 0);
    });
  
  while (GRAVITY &lt; 0) {
    time = getText("time");
    range = getText("x_range");
    angle = getText("launch");
    v_yo = 0 - GRAVITY * (time/2);
    horizontal_velocity();
    maximum_height();
  }
  </code></pre>
  
  <p>The results work perfectly fine (<a href="https://studio.code.org/projects/applab/6E6Tn2pIgXLFaOxt6ZqOTg" rel="nofollow noreferrer">test it here</a>) but the one thing that is not working is the <code>Clear</code> buttons... well just the first for now. The rest do not have any code attached. So to "clear" the text field under the label <code>Time in Seconds</code>, you need to click the button. This should have triggered the <code>onEvent()</code> in the code and call <code>setText("timey", 0)</code> which is supposed to replace the current text with a <code>0</code>.</p>
  
  <p>Unfortunately during debug, it shows that when the button is clicked, it doesn't even call the <code>onEvent()</code> which doesn't allow the first button to work. For those curious about what <code>onEvent()</code> does, check this <a href="https://code.org/applab/docs/onEvent" rel="nofollow noreferrer">doc</a>. <strong>So why is <code>onEvent()</code> not being called even though the id of the button <code>timey</code> and the second parameter <code>click</code> corresponds to the correct button and action respectively.</strong> Also, the code within <code>onEvent()</code> is a function, which is legal if you check the third example in the doc. </p>
  
  <p>The editor also includes a design section:</p>
  
  <p><a href="https://i.stack.imgur.com/23zjj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/23zjj.png" alt="enter image description here"></a></p>