classes-tutorial-$5.lzx

<canvas width="100%" height="180">
  <resource name="standardButton">
    <frame src="resources/button_blue.gif"/>
    <frame src="resources/button_green.gif"/>
  </resource>

  <resource name="specialButton">
    <frame src="resources/button_red.gif"/>
    <frame src="resources/button_green.gif"/>
  </resource>

  <class name="MyButton" resource="standardButton" onclick="doAction()" onmouseover="doOver()" onmouseout="doOut()">
    <method name="doAction"> pet.addText("dog "); </method>
    <method name="doOver"> this.setAttribute('frame', 2); </method>
    <method name="doOut"> this.setAttribute('frame', 1); </method>
  </class>

  <class name="MySpecialButton" extends="MyButton" resource="specialButton">
    <method name="doAction"> weekday.addText("Monday "); </method>
  </class>

  <view name="buttons" x="5" y="5">
    <simplelayout axis="y" spacing="10"/>
    <MyButton/>
    <text id="pet"/>
    <MySpecialButton/>
    <text id="weekday"/>
  </view>
</canvas>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
  * Copyright 2008 Laszlo Systems, Inc.  All Rights Reserved.                   *
  * Use is subject to license terms.                                            *
  * X_LZ_COPYRIGHT_END ****************************************************** -->

Cross References

Resources

Name Source Image
standardButton resources/button_blue.gif
resources/button_green.gif
specialButton resources/button_red.gif
resources/button_green.gif

Classes

Named Instances