Hello, this is a simple example. In it, the "okey" variable is switched "true / false" and, depending on the check, is displayed in the appropriate layer
|
Source code
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
<action name="start" autorun="onstart">
set(okey, false);
set(yes_ch, 0);
set(no_ch, 0);
</action>
<layer name="test" type="text" html="click" onclick="switch(okey); chek();"/>
<action name="chek" >
if(okey,
inc(yes_ch);
calc(layer[yes_l].html, 'YES = ' + yes_ch);
,
inc(no_ch);
calc(layer[no_l].html, 'NO = ' + no_ch);
);
</action>
<layer name="yes_l" type="text" x="100" html="YES = 0" />
<layer name="no_l" type="text" x="200" html="NO = 0" />
|