/*
Get hotspot ath, atv value
*/
<hotspot name="dragmessage" keep="true" devices="html5" width="168" height="32"
url="%SWFPATH%/plugins/message.js?v2" renderer="css3d" border="false" backgroundalpha="0" bgalpha="0" ondown="draghotspot();"
ath="0.0" atv="0.0" visible="false" zoom="false" mode="drag" distorted="false" edge="leftbottom"
/>
<action name="draghotspot">
spheretoscreen(ath, atv, hotspotcenterx, hotspotcentery, 'l');
sub(drag_adjustx, mouse.stagex, hotspotcenterx);
sub(drag_adjusty, mouse.stagey, hotspotcentery);
asyncloop(pressed,
sub(dx, mouse.stagex, drag_adjustx);
sub(dy, mouse.stagey, drag_adjusty);
screentosphere(dx, dy, ath, atv);
set_hotspot_pos();
);
</action>
<action name="set_hotspot_pos"><![CDATA[
copy(print_ath, ath);
copy(print_atv, atv);
roundval(print_ath, 3);
roundval(print_atv, 3);
copy(layer[dragdb].ath,print_ath);
copy(layer[dragdb].atv,print_atv);
]]>
</action>
/*
dynamically create a hotspot
*/
<action name="addmessage">
addhotspot(%1);
set(hotspot[%1].name,%1);
set(hotspot[%1].keep,"false");
set(hotspot[%1].devices,"html5");
set(hotspot[%1].width,"128");
set(hotspot[%1].height,"32");
set(hotspot[%1].url,"%SWFPATH%/plugins/lemessage.js?v1");
set(hotspot[%1].renderer,"css3d");
set(hotspot[%1].border,"false");
set(hotspot[%1].backgroundalpha,"0");
set(hotspot[%1].bgalpha,"0");
set(hotspot[%1].ath,%2);
set(hotspot[%1].atv,%3);
set(hotspot[%1].visible,"true");
set(hotspot[%1].zoom,"false");
set(hotspot[%1].edge,"leftbottom");
set(hotspot[%1].distorted,"false");
</action>
use the draghotspot function get atv,ath value;
use the addmessage function dynamically create a hotspot, but after adding, the hotspot position has a big shift, how is this going on.
when rotating up and down after the zoom view, hotspot location will be shifted,where I do wrong, how to fixed hotspot?
thanks for your help.