create hotspot by animation image

  • dear all
    I create hotspot with js,the image is an animation ,but the hotspot is not display,in xml it's display.may be some function is wrong . thanks all!

    the xml is:
    <style name="hotspot_ani_black" url="plugins/animatedhotspot_black.png" crop="0|0|64|64" framewidth="64" framewidth="64" frame="0" lastframe="19" onloaded="hotspot_animate();"></style>
    <scene>
    <hotspot name="spot2" style="hotspot_ani_black" ath="15" atv="12" >
    </hotspot>
    </scene>


    the js is:

    function addHotspot1(hotspot,krpano){
    var str="addhotspot("+hotspot.name+");"
    str+="set(hotspot["+hotspot.name+"].ath,"+hotspot.ath+");";
    str+="set(hotspot["+hotspot.name+"].atv,"+hotspot.atv+");";
    str+="set(hotspot["+hotspot.name+"].url,../plugins/animatedhotspot_black.png);";
    str+="set(hotspot["+hotspot.name+"].style,"+hotspot.style+");";
    str+="set(hotspot["+hotspot.name+"].linkedscene,scene_b);";
    str+="set(hotspot["+hotspot.name+"].frame,0);";
    str+="set(hotspot["+hotspot.name+"].lastframe,19);";
    str+="set(hotspot["+hotspot.name+"].crop(0,0,64,64));";/////may be wrong
    str+="set(hotspot["+hotspot.name+"].framewidth,64);";
    str+="set(hotspot["+hotspot.name+"].frameheight,64);";
    str+="set(hotspot["+hotspot.name+"].width,64);";
    str+="set(hotspot["+hotspot.name+"].height,64);";
    str+="set(hotspot["+hotspot.name+"].zoom,true);";
    str+="set(hotspot["+hotspot.name+"].keep,false);";
    str+="set(hotspot["+hotspot.name+"].ondown,draghotspot(););";
    str+="set(hotspot["+hotspot.name+"].onover,tween(scale,0.55););";
    str+="set(hotspot["+hotspot.name+"].onout,tween(scale,0.5););";
    str+="set(hotspot["+hotspot.name+"].onclick,looktohotspot(get(name),65));";
    str+="set(hotspot["+hotspot.name+"].onloaded,do_crop_animation(););";

    krpano.call(str);
    };

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!