You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

publicitarios360

Intermediate

  • "publicitarios360" started this thread

Posts: 227

Location: Habana, Cuba

Occupation: Architect, Photographer.

  • Send private message

1

Saturday, June 18th 2016, 6:14pm

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:

mypagewe.html/action1

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

Any advice?

Thanks in advanced

Fernando

publicitarios360

Intermediate

  • "publicitarios360" started this thread

Posts: 227

Location: Habana, Cuba

Occupation: Architect, Photographer.

  • Send private message

3

Sunday, June 19th 2016, 1:47am

please check this ols post unanswered...

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

4

Monday, June 20th 2016, 1:28am

*confused* *confused* *confused* .. examples are your friends .. look into it carefully ..

publicitarios360

Intermediate

  • "publicitarios360" started this thread

Posts: 227

Location: Habana, Cuba

Occupation: Architect, Photographer.

  • Send private message

5

Monday, June 20th 2016, 4:01am

Solution ok for flash, but fail in HTML5

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

publicitarios360

Intermediate

  • "publicitarios360" started this thread

Posts: 227

Location: Habana, Cuba

Occupation: Architect, Photographer.

  • Send private message

6

Monday, June 20th 2016, 10:49pm

Solved!!!

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.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