about javascript , it's always warn : krpano().call is not a function. help me please , thank you !

  • <div id="call_id" onclick="moveto('+90','0')">click here</div>
    <div id="krpano">
    <noscript><table width="100%" height="100%"><tr valign="middle"><td><center>ERROR:<br><br>Javascript not activated<br><br></center></td></tr></table></noscript>
    </div>

    <script type="text/javascript" src="swfkrpano.js"></script>

    <script type="text/javascript">


    var so = new SWFObject("krpano.swf", "krpanoSWFObject", "100%", "100%", "9.0.28","#000000");
    so.addParam("allowFullScreen","true");
    so.addVariable("pano", "pano.xml");
    so.useExpressInstall("swfobject/expressinstall.swf");
    so.setAttribute('xiRedirectUrl', window.location);
    so.write("krpano")


    function krpano(){
    return document.getElementById("krpanoSWFObject");
    }

    function moveto(toh, tov){
    krpano().call("moveto(" + toh +"," + tov + ")");
    }

    </script>

    *confused*

  • Hi,

    do you test online or offline/locally?

    if offline/locally please see here:
    https://krpano.com/docu/localusage/

    best regards,
    Klaus

    Thank you very much !
    but I met another problem !

    Quote

    Note - when the xml was loaded by the loadpano action and there are additional action commands after the loadpano call, then the onstart event will be skipped!

    is any method to solve this problem?

    my javascript code is

    Code
    document.getElementById("krpanoSWFObject").call("loadpano("js_load_xml.xml",null,IGNOREKEEP,BLEND(1))");


    and in js_load_xml.xml has the code

    Code
    <krpano version="1.0.8" onstart="loadscene(scene1,null,MERGE);">


    it don't load the scene1 .
    Is it any method to load scene1 . thank you !

  • Hi,

    in this case the onstart event should still happen...
    or do you have additional calls after the loadpano() call?

    if not - you could call loadscene() manually after the loadpano() call,
    or you could try calling "onstart()" after the loadpano() call,

    best regards,
    Klaus

Participate now!

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