I've done some testing with the mixin implementation. There is a bug
if you define a mixin with a view child, and have the class using the
mixin extend "node". Here's some example code:

<canvas debug="true">

  <mixin name="mixin1">
    <view name="redView" width="100" height="100" bgcolor="red">
    </view>
  </mixin>

  <class name="class1" extends="node" with="mixin1">
    <handler name="oninit">
      var r = canvas.searchSubnodes("name", "redView");
      Debug.info("redView = ", r);
      Debug.info("redView.parent = ", r.parent);
    </handler>
  </class>

  <class1 />

</canvas>

The SWF10 runtime doesn't show any error, and the debug output is:
INFO: redView = <view>#0 | /class1/@redView
INFO: redView.parent = <class1>#2| class1

The DHTML runtime throws a TypeError:
Uncaught TypeError: Object class1 has no method 'addSubview'

Guess the compiler would have to throw an error when a subclass of
node uses a mixin which contains views. But then, I just realize that
the compiler doesn't warn if you add a view to a subclass of node when
not using a mixin. What should the compiler do in such a case?

Reply via email to