title: Handling events fired by Property of ActiveX Control in HTML/Javascript
body: <p>The following HTML object represents an ActiveX control that has a property named SubSystemA:</p>
  
  <pre><code>&lt;object id="MainObject"
      CLASSID="CLSID:2C327457-D12F-4FC4-BFC2-D7C029003D07"
      width="0px" height="0px"
      &gt;
      &lt;embed name="MainObject"&gt;&lt;/embed&gt;
  &lt;/object&gt;
  </code></pre>
  
  <p>SubSystemA is a COM object implementing some interface with methods, properties, and events.  SubSystemA's methods and properties are easily callable from Javascript, but since SubSystemA is a property of MainObject, I am not sure how to attach an event handler to SubSystemA's events.</p>
  
  <p>I know of two ways to handle events fired by MainObject:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function MainObject::SomeMainEvent(arg1, arg2)
      {
           // Event handling logic
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>&lt;script type="text/javascript" for="MainObject" event="SomeMainEvent(arg1, arg2)"&gt;
      // Event handling logic
  &lt;/script&gt;
  </code></pre>
  
  <p>But how would one handle an event for MainObject.SubSystemA?</p>