title: How to add js onclick event to aframe animation
body: <p>I have a spaceship model that I would like to animate taking off. I would like it to be so that the animation would activate once I click on the spaceship with my cursor. I have the animation working using  but I would like it to activate upon a cursor click event. Below is my HTML and where I got stuck with the JS</p>
  
  <pre><code>&lt;a-entity id="spaceship" cursor-animator gltf-model="models/spaceship.gltf" position="-20 -0.855 -5.259" scale="2 2 2" rotation="0 180 0"&gt;
    &lt;a-animation attribute="position" from="-20 0 -5" to="-20 0 -25" dur="10000"&gt;&lt;/a-animation&gt;
    &lt;a-animation attribute="position" from="-20 0 -25" to="-20 1000 -200" delay="9000" dur="9000"&gt;&lt;/a-animation&gt;
  &lt;/a-entity&gt;
  
  
  // Component to activate spaceship animation on click
  AFRAME.registerComponent('cursor-animator', {
  init: function () {
  this.el.addEventListener('click', function (evt) {
      //Code
    console.log('I was clicked at: ', evt.detail.intersection.point);
  });
  }
  });
  </code></pre>