this me hotspot
<hotspot name="altimeter_rotary"
url="image/bokovaya_right/emptyrotaty.png"
distorted="true" alpha="1" capture="false" depth="off" handcursor="true"
zorder="7" zoom="false" ath="-76.36" atv="20.84"
width="40" height="prop" rx="0"
ry="0" rz="0" ox="0" oy="0" rotate="-2" scale="0.15"
edge="center" enabled="true" visible="true" keep="false"
onover="showselector(altimeter_rotary);"
onout="hideselector();"
onclick="potentiometers_click(altimeter_rotary, 1);"
relvar="altimeter_rotary_v" //<--relvar
descr="Радиовысотомер" >
<selector name="sover" ath="-76.4" atv="20.74" width="50" height="prop" rx="0" ry="0" rz="0" ox="0" oy="0" scale="0.3" rotate="0" edge="center" />
<state name="stateright" sox="12" soy="0" scale="0.3" minangle="0" maxangle="360" delta="1"
rotscale="calc(rvalue,(vvalue));" valuescale="calc(vvalue,(rvalue));" />
<state name="stateleft" sox="-12" soy="0" scale="0.3" minangle="0" maxangle="360" delta="1"
rotscale="calc(rvalue,(vvalue));" valuescale="calc(vvalue,(rvalue));" />
</hotspot >
me onclick action
<action name="potentiometers_click" scope="local" args="hot,tw" >
clearselectors();
set(style[posbtnson].ath,get(hotspot[get(hot)].selector[sover].ath));
set(style[posbtnson].atv,get(hotspot[get(hot)].selector[sover].atv));
set(style[posbtnson].rx,get(hotspot[get(hot)].selector[sover].rx));
set(style[posbtnson].ry,get(hotspot[get(hot)].selector[sover].ry));
set(style[posbtnson].rz,get(hotspot[get(hot)].selector[sover].rz));
hotspot[pos_left].loadstyle(posbtnson);
set(hotspot[pos_left].url,%SWFPATH%/module/interface/selector_ccw.png);
set(hotspot[pos_left].ox,get(hotspot[get(hot)].state[stateleft].sox));
set(hotspot[pos_left].oy,get(hotspot[get(hot)].state[stateleft].soy));
txtadd(funcvar,'set(tweennum,',get(tw),');stopdelayedcall(selectorsoff);setpotentstate(',get(hotspot[get(hot)].name),',stateleft');');
txtadd(funcvarOT,'if(plugin[WebVR].isenabled,,',get(funcvar),');');
txtadd(funcvarVR,'if(plugin[WebVR].isenabled,',get(funcvar),');');
set(hotspot[pos_left].onover,get(funcvarVR));
set(hotspot[pos_left].ondown,get(funcvarOT));
hotspot[pos_right].loadstyle(posbtnson);
set(hotspot[pos_right].url,%SWFPATH%/module/interface/selector_cw.png);
set(hotspot[pos_right].ox,get(hotspot[get(hot)].state[stateright].sox));
set(hotspot[pos_right].oy,get(hotspot[get(hot)].state[stateright].soy));
txtadd(funcvar,'set(tweennum,',get(tw),');stopdelayedcall(selectorsoff);setpotentstate(',get(hotspot[get(hot)].name),',stateright');');
txtadd(funcvarOT,'if(plugin[WebVR].isenabled,,',get(funcvar),');');
txtadd(funcvarVR,'if(plugin[WebVR].isenabled,',get(funcvar),');');
set(hotspot[pos_right].onover,get(funcvarVR));
set(hotspot[pos_right].ondown,get(funcvarOT));
setkeycontrolmode(regul);
unlockselectors();
</action >
<action name="setpotentstate" scope="local" args="hname, hstate" >
asyncloop(tweennum,
set(rvalue,get(hotspot[get(hname)].rotate));
set(minval,get(hotspot[get(hname)].state[stateleft].minangle));
set(maxval,get(hotspot[get(hname)].state[stateleft].maxangle));
set(deltaval,get(hotspot[get(hname)].state[stateleft].delta));
if(hstate == stateleft,
sub(rvalue,deltaval);
,
add(rvalue,deltaval);
);
clamp(rvalue,get(minval),get(maxval));
set(vvalue, get(varvalues[params].varvalue[get(hotspot[get(hname)].relvar)].value));
callwith(hotspot[get(hname)],get(hotspot[get(hname)].state[stateleft].valuescale));
roundval(vvalue);
setvarvalue(params,get(hotspot[get(hname)].relvar),get(vvalue));
if(tweennum==1,wait(0);
,tweennum==2,wait(0.1);
,tweennum==3,wait(0.2);
);
);
</action >
onchange action
<action name="setvarvalue" scope="local" args="group,vname,vvalue" >
set(varvalues[get(group)].varvalue[get(vname)].value,get(vvalue));
if(varvalues[get(group)].varvalue[get(vname)].onchange!='',
set(acts,get(varvalues[get(group)].varvalue[get(vname)].onchange));
scope(global,get(acts));
);
</action >
rotate action
<action name="readpotentstate" scope="local" args="hname" >
set(vvalue, get(varvalues[params].varvalue[get(hotspot[get(hname)].relvar)].value));
callwith(hotspot[get(hname)],get(hotspot[get(hname)].state[stateleft].rotscale));
<!-- trace('ANG = ',get(rvalue));-->
set(hotspot[get(hname)].rotate, get(rvalue));
</action >
me scope
<varvalues name="params" >
<varvalue name="altimeter_rotary_v" value="0" delta="1" dtype="int0" defvalue="1" minvalue="0" maxvalue="300"
onchange="readpotentstate(altimeter_rotary); " /> //-- me action for onchange
</varvalues>