scripting-tutorial-$15.lzx
<canvas width="100%" height="200">
<window x="100" y="60" title="Window 2" name="windowTwo" id="windowTwoId">
<method name="moveWindow" args="direction">
// decide which direction to go
if (direction == "left") {
var increment = -20;
} else if (direction == "right") {
var increment = 20;
}
var originalX = this.x;
var newX = originalX + increment;
this.setAttribute('x', newX);
</method>
<text>This is the second window.</text>
</window>
<window x="20" y="20" width="210" title="Simple Window">
<simplelayout axis="x" spacing="4"/>
<button text="Move Left" name="button1" onclick="windowTwoId.moveWindow('left')"/>
<button text="Move Right" onclick="windowTwoId.moveWindow('right')"/>
</window>
</canvas>
Cross References
Named Instances