script to the root path

  • this is a little variation to the script that can use to avoid error to the path and leave the orginal file inside a foldere placed everywhere:

    in red variaton to original script. the Param base point your script at the folder of your work, so you will never have problem with plugins and files.
    in green name of your file and your root this is just example. this must change every new work with the new name and/or folder

    <script type="text/javascript">
    // <![CDATA[
    if (typeof(deconcept) !== 'undefined' && deconcept.SWFObjectUtil.getPlayerVersion().major >= 6)
    {
    var root =' direction/to/ your/folder/'; // immettere qui il path alla root dei file
    var so = new SWFObject(""+root+"krpano.swf", "krpanoSWFObject", "100%", "100%", "9.0.28","#fff");
    so.addParam("allowFullScreen","true");
    so.addParam("base", ""+root+"");
    so.addVariable("pano", ""+root+"yourfile.xml");
    so.useExpressInstall(""+root+"swfobject/expressinstall.swf");
    so.setAttribute('xiRedirectUrl', window.location);
    if ( so.write("krpano") ) { var mousewheelfixes = new SWFkrpanoMouseWheel(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>

  • Quote

    i hope to bring back to life this post!;)

    i try to use relative path for tour.html file (i have created one for each scene and put them into a subdirectory). this is my code:


    <script>
    var root ='http/http://www.photospherical.it/VT/2014/hotelpontesisto'; // immettere qui il path alla root dei file
    embedpano({swf:""+root+"tour.swf", xml:""+root+"tour.xml", target:"pano", html5:"auto", vars:{startscene:"scene_Ascensore_Chiuso"}, bgcolor:"#FFFFFF", passQueryParameters:true});
    </script>

    but doesn't work. i'm trying also ../tour.swf but nothing:(


    Resolved:)


    <script src="../tour.js"></script>

    <div id="pano" style="width:100%;height:100%;">
    <noscript><table style="width:100%;height:100%;"><tr style="valign:middle;"><td><div style="text-align:center;">ERROR:<br/><br/>Javascript not activated<br/><br/></div></td></tr></table></noscript>
    <script>
    var url = window.location.pathname.toLowerCase();
    var ext = url.lastIndexOf(".html");
    var basename = url.slice(url.lastIndexOf("/",ext)+1, ext);
    embedpano({swf:"../tour.swf", xml:"../tour.xml", target:"pano", html5:"auto", vars:{startscene:basename}, bgcolor:"#FFFFFF", passQueryParameters:true});
    </script>
    </div>

    i have only a little problem with gallery plugin:

    "download of "thumbnailsframe.png" failed" (this file is called by thumbnails.swf plugin).

Participate now!

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