Hi!
Customers often ask me about scenes direct link (url) in the tour.
Well, krpano has great feature pass url params to xml.
And here is small tutorial of how to use it.
First, you need to set
passQueryParameters to true
example:
embedpano({swf:"tour.swf", xml:"tour.xml", target:"pano",
passQueryParameters:
true });
then you can use any variable names in url string
for example:
yourdomain.com/mytours/tour.htm?some_variable=value_of_variable&more_var=its_value
and so on
all this variables will be passed to xml and you can get it's values
like get(some_variable) or get(more_var)
So, what if we want to start specific scene from url?
then let's use start_scene for define which scene to start.
your url will be like this
yourdomain.com/mytours/tour.htm?start_scene=scene_name_or_index
and in xml
some start action
|
Source code
|
1
2
3
4
5
6
7
8
9
10
|
<krpano onstart="start();"
<action name="start">
<!-- set default start scene if start_scene is not defined -->
if(start_scene === null, set(start_scene,0); );
loadscene(get(start_scene));
</action>
...
</krpano>
|
you can pass start view same way or any other variables to your tour xml.
Well, I hope you will find it usefull
Best wishes
Andrey