Is there a way of retrieving the name / title of the current scene in 1.0.8.12 ?
I understand how to get one if you know the name of the scene you want, but not how to retrive the *current* scene.
Thanks,
Is there a way of retrieving the name / title of the current scene in 1.0.8.12 ?
I understand how to get one if you know the name of the scene you want, but not how to retrive the *current* scene.
Thanks,
try get(xml.scene);
I have not tested it yet but Klaus had a suggestion here.
http://www.krpano.com/forum/wbb/inde…d&threadID=4126
Hans
You should use the concept of a state machine to determine which scene is loaded. When you trigger the event which loads the next scene such as 'onclick' you should call a function that changes the state and calls another function that makes changes dependent upon the new scene. So the onclick event has a function call with the new state passed as a parameter.
<hotsplot name="first"
...
onclick="switchScene(first);"
...
/>
<action name="switchScene">
if(hotspot[
...
try get(xml.scene);
Thanks - this worked a treat - I actually used
to get the title of the current scene. I was using it to set a value of a text field, based on the scene's title.
I didn't want to have to use a "state machine" as this would involve duplicating a lot of code, making it harder to edit in the future. Thanks for everyone's help.
I use "get(scene[get(xml.scene)].name))" to get name of scene but it not return exactly. E.x: in xml, name of scene is "scene_IMG_2752_Panorama" but it return "scene_img_2752_panorama".
use additional attribute
"title" for example
additional attributes are keysensitive
Regards
Andrey
Don’t have an account yet? Register yourself now and be a part of our community!