How to change the action with variable from external command?

  • Hi, Action from webpage is easy and there is in the krpano´s help anf forum, thanks,

    Krpano.call("the action()");

    Ok, but How to change the action with variable from external command?

    For example:

    mypageweb_action1.html

    mypageweb_action2.html


    mypageweb_action3.html


    mypageweb_action4.html


    Solved the problem, but is not correct (too much webpages!!) I´am studying java script looking for anything as:

    http://mypagewe.html/action1

    Only one webpage and a lot the parameters as action1, action2, etc....

    Any advice?

    Thanks in advanced

    Fernando

  • Load scene querystring based

    This is exactly that I need!!!

    The content was:
    Load scene querystring based


    My question may be stupid, but....
    I have a virtual tour with 10 scene; now the Virtual Tour start with the scene 0, because i use this simple code unload


    loadscene(get(scene[0].name), null, MERGE);

    My question is: how to start the Virtual Tour with a different scene, loading dynamically the value of the scene?
    My idea is use a GET parameter in the html page

    For example:
    http://www.cxcxxxx.com/panorama.html?scene=1 =====> START with the scene 1
    http://www.cxcxxxx.com/panorama.html?scene=3 =====> START with the scene 3


    but how to get the value of query string into the xml?

    Or my approach is bad? Thank you

  • This is the HTML:

    <!DOCTYPE html>
    <html>
    <head>
    <title>PRUEBA!!!!</title>
    <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, minimal-ui" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <meta http-equiv="x-ua-compatible" content="IE=edge" />
    <style>
    @-ms-viewport { width:device-width; }
    @media only screen and (min-device-width:800px) { html { overflow:hidden; } }
    html { height:100%; }
    body { height:100%; overflow:hidden; margin:0; padding:0; font-family:Arial, Helvetica, sans-serif; font-size:16px; color:#FFFFFF; background-color:#000000; }
    </style>

    </head>
    <body>

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

    <div id="pano" style="width:100%;height:100%;">

    <noscript><table style="width:100%;height:100%;"><tr style="vertical-align:middle;"><td><div style="text-align:center;">ERROR:<br/><br/>Javascript not activated<br/><br/></div></td></tr></table></noscript>

    <script>
    embedpano({
    swf:"tour.swf",
    xml:"tour.xml",
    target:"pano",
    html5:"prefer",
    onready:krpanoReady,
    passQueryParameters:true
    });
    var krpano = document.getElementById("krpanoSWFObject");
    var myvar = getQueryString(' myvar' );
    function krpanoReady(krpano)
    {
    krpano.call(myvar);
    }
    </script>
    </div>
    </body>
    </html>

    This is the link to the HTML:
    file:///D:/wamp1/www/000maqueta_grande/vtour/prueba1.html?myvar=plazarmas(page)


    The above code runs ok in Flash but fails in HTML5. In HTML5 myvar (in the url) is not recognized by html code

  • SOLVED!!! for Flash and HTML5

    The idea was to access krpano actions from only one webpage, changing the url. For example:

    The local url file:///D:/wamp1/www/000maqueta_grande/vtour/prueba5.html?image=focsa(page) runs the action "focsa(page)" that center the Focsa building in scale model of Habana City.

    file:///D:/wamp1/www/000maqueta_grande/vtour/prueba5.html?image=bacardi(page) runs the action "bacardi(page)" that center the Bacardi building in scale model of Habana City.

    The URL that changes is called "query string" and it is very usefull for links from other webpages, app, etc.

    The html:

    <!DOCTYPE html>
    <html>
    <head>
    <title>PRUEBA!!!!</title>
    <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, minimal-ui" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <meta http-equiv="x-ua-compatible" content="IE=edge" />
    <style>
    @-ms-viewport { width:device-width; }
    @media only screen and (min-device-width:800px) { html { overflow:hidden; } }
    html { height:100%; }
    body { height:100%; overflow:hidden; margin:0; padding:0; font-family:Arial, Helvetica, sans-serif; font-size:16px; color:#FFFFFF; background-color:#000000; }
    </style>

    </head>
    <body>

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

    <div id="pano" style="width:100%;height:100%;">

    <noscript><table style="width:100%;height:100%;"><tr style="vertical-align:middle;"><td><div style="text-align:center;">ERROR:<br/><br/>Javascript not activated<br/><br/></div></td></tr></table></noscript>

    <SCRIPT LANGUAGE="javascript">
    embedpano({
    swf:"tour.swf",
    xml:"tour.xml",
    target:"pano",
    html5:"prefer",
    onready:krpanoReady,
    passQueryParameters:true
    });
    var krpano = document.getElementById("krpanoSWFObject");
    var myvar = "plazarmas(page)";
    function krpanoReady(krpano)
    {
    //krpano.call(myvar);
    //window.alert(myvar);
    }
    </script>
    <SCRIPT LANGUAGE="javascript">
    function getQueryVariable(variable)
    {
    var query = window.location.search.substring(1);
    var vars = query.split("&");
    for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if(pair[0] == variable){return pair[1];}
    }
    return(false);
    }
    var myvar = getQueryVariable("image");
    //window.alert(myvar);
    krpano.call(myvar);
    </SCRIPT>
    </div>
    </body>
    </html>

    Greets,

    Fernando

Participate now!

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