You are not logged in.

1

Tuesday, February 2nd 2021, 7:59am

javascript : know when the user changes scene

Hello,

I have a javascript application.
In my html page, I have a "div" where a krpano scene is integrated.
I'm looking for the event that is provoked when the user changes scenes (always the same xml, but another scene).
Does anyone have the solution ?
Thanks for your suggestions
Best regards

2

Tuesday, February 2nd 2021, 8:40am

see here
https://krpano.com/docu/xml/#events

<events name="myname" keep="true" onnewscene="trace('new scene=',xml.scene);" />

3

Wednesday, February 3rd 2021, 7:13pm

Hello Klaus,

Thank you for the proposal.
Sorry for my difficulties, but if my javascript object is
krpanoScene
(for example: var krpanoScene = krpanoSceneG.get("xml.scene");)

How should I code, in javascript to detect a change in the scene through the navigation buttons in the "tour" tools
Your quick help is precious


Best regards
Vincent

4

Wednesday, February 3rd 2021, 9:13pm

Source code

1
2
3
var e = krpanoSceneG.events.createItem("myname");
e.keep = true;
e.onnewscene = function() { console.log("new scene=" + krpanoSceneG.get("xml.scene"); };

untested, check yr console if it works