why does it not working?

  • I was trying to transfer data form the html to the panorama to make a "mute button" called from a link in the html where the pano is embed. Iwas using the Krpano example...(https://krpano.com/examples/javascript2/), but after some hours without success, I decided to take all the code to test what I was doeing wrong. so I took it and changed just the rutes to the files... but it's not working... anyone can say me what is wrong? or any idea to make this mute button called externaly from a link?

    thank's a lot, and sorry for my english!! *smile*

    This is the code I was talking about:

    <html>
    <head>
    <title>krpano.com example</title>
    </head>
    <style>
    body{ font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#333333; background-color:#FFFFFF; margin:20; padding:0; }
    * html, * html body{ overflow: hidden; }
    a{ color:#000000; text-decoration:none; display:block; padding:5px; margin:1px; border:1px solid #666666; background-color:#AAAAAA; cursor:pointer;}
    a:hover{ color:#000000; text-decoration:none; background-color:#EEEEEE;cursor:pointer; }
    table{ font-size:14px; background-color:#000000; color:#FFFFFF;}
    </style>
    <body>

    <center>

    <h2><i>krpano.com</i> - Javascript Example 2</h2>

    <table width="800px">
    <tr>
    <td>
    <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>
    </td>

    <td>

    <div style="border:1px solid white; padding:5px;">
    <span><b><u>lookat:</u></b></span><br>
    <span>h-angle:</span><span id="hlookat"></span><br>
    <span>v-angle:</span><span id="vlookat"></span><br>
    <span>fov:</span><span id="fov"></span><br>
    </div>


    <br>
    <a onclick="getlookat()">click to get lookat once</a>
    <br>
    <a onclick="start_getlookat()">click to continuous get lookat</a>
    <a onclick="stop_getlookat()">click to stop continuous get</a>
    <br>
    <a onclick="lookat(-90,0)">click to lookat -90/0</a>

    <a onclick="lookat(0,0)">click to lookat 0/0</a>
    <a onclick="lookat(+90,0)">click to lookat +90/0</a>
    <br>
    <a onclick="moveto(-90,0)">click to moveto -90/0</a>
    <a onclick="moveto(0,0)">click to moveto 0/0</a>
    <a onclick="moveto(+90,0)">click to moveto +90/0</a>

    <br>
    <a onclick="lookto(Math.random()*360,-90+Math.random()*180,30+Math.random()*130)">click for a random lookto</a>

    </td>
    </tr>
    </table>

    </center>


    <script type="text/javascript" src="https://krpano.com/swfkrpano.js"></script>

    <script type="text/javascript">
    // <![CDATA[
    if (typeof(deconcept) !== 'undefined' && deconcept.SWFObjectUtil.getPlayerVersion().major >= 6)
    {
    var so = new SWFObject("https://krpano.com/krpano.swf", "krpanoSWFObject", "600", "400", "9.0.28","#000000");
    so.addParam("allowFullScreen","true");
    so.addVariable("pano", "https://krpano.com/examples/javascript2/javascript2.xml");
    so.useExpressInstall("http://krpano/swfobject/expressinstall.swf");
    so.setAttribute('xiRedirectUrl', window.location);
    if ( so.write("krpano") ) { var macmousewheel = new SWFMacMouseWheel(so); }
    }
    else
    {
    document.getElementById("krpano").innerHTML = '<table width="100%" height="100%"><tr valign="middle"><td><center>ERROR:<br><br>Adobe Flash Player 9 needed<br><br><br><a href="http://www.adobe.com/go/getflashplayer/" target="_blank"><IMG SRC="http://www.macromedia.com/images/shared/…lash_player.gif" BORDER="1"></a><br>...click here to download...<br><br><br><br></center></td></tr></table>';
    }
    // ]]>
    </script>

    <script type="text/javascript">
    // <![CDATA[

    var lookat_interval;

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

    function getlookat()
    {
    var hlookat = Number( krpano().get("view.hlookat") );
    var vlookat = Number( krpano().get("view.vlookat") );
    var fov = Number( krpano().get("view.fov") );

    document.getElementById("hlookat").innerHTML = hlookat.toFixed(2);
    document.getElementById("vlookat").innerHTML = vlookat.toFixed(2);
    document.getElementById("fov").innerHTML = fov.toFixed(2);
    }

    function start_getlookat()
    {
    lookat_interval = setInterval( 'getlookat()', 66 );
    }

    function stop_getlookat()
    {
    clearInterval( lookat_interval );
    }

    function lookat(ath, atv)
    {
    krpano().call( "lookat(" + ath +"," + atv + ")" );
    }

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

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


    // ]]>
    </script>


    </body>
    </html>

  • Hi,

    are you really trying these paths: ?

    try using local files or having all files from your the own server,
    and if testing locally don't forget to adjust the Flashplayer security settings:
    https://krpano.com/docu/localusage/

    best regards,
    Klaus

Participate now!

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