states-$5.lzx
<canvas height="200" width="100%">
<class name="testState" extends="state">
<attribute name="countApplies" type="number" value="0
" setter="this.countApplies = countApplies"/>
<handler name="onapplied">
if(this.applied == true){
this.setAttribute('countApplies', this['countApplies'] >= 0 ? ++this.countApplies : 1);
}
</handler>
</class>
<button>Try it
<handler name="onclick">
ts.setAttribute('applied', true);
message.addText("\napplies: " + ts.countApplies);
ts.setAttribute('applied', false);
</handler>
<testState name="ts"/>
</button>
<text id="message" y="30" multiline="true"/>
</canvas>
Cross References
Classes
Named Instances