videotogglebutton.lzx
<library>
<class name="videotogglebutton" frame="${this.frameTable[ (this.over ? 1 : 0) + (this.tracking ? 2 : 0) + (this.engaged ? 4 : 0)]}">
<attribute name="frameTable" value="$once{ [1, 2, 1, 2, 3, 3, 3, 3]}"/>
<attribute name="over" value="false
"/>
<attribute name="tracking" value="false
"/>
<attribute name="engaged" value="false
"/>
<attribute name="icon" type="string" value="
"/>
<handler name="onmouseover">
this.setAttribute('over', true);
</handler>
<handler name="onmouseout">
this.setAttribute('over', false);
</handler>
<handler name="onmousedown">
this.setAttribute('tracking', true);
</handler>
<handler name="onmouseup">
this.setAttribute('tracking', false);
if (this.over) {
this.trigger();
}
</handler>
<method name="trigger">
this.setAttribute("engaged", !this.engaged);
</method>
</class>
</library>