detecting scene change in javascript

  • I have most of my application's control via javascript. I need to updated an external div if/when a scene is changed. So there are two ways I can see doing it, neither of which I know how to do :)

    (1) Can I get a javascript event triggered when a new scene is selected within a pano viewing session? I don't think this is possible, but if it is, this would work the best for me.

    (2) I can intermittetly query the scene name to detect a change. So is there a way for javascript to ask what the name of the current scene is? I'm thinking something like this:

    Code
    function getSceneName(){
    var name = document.getElementById("krpanoSWFObject").get('scenename');
    alert(name);
    }
    .........
    <a href="#" onclick="getSceneName();return false;">what is the current scene?</a>

    How can I get the current scene name? What variable do I need to check for?

    I have to think that (1) might not be possible, but I have to think that (2) is possible. Any help please?

  • Hi,

    Zitat

    (1) Can I get a javascript event triggered when a new scene is selected within a pano viewing session? I don't think this is possible, but if it is, this would work the best for me.

    you can use the onxmlcomplete or the new onnewpano events (since 1.0.8.14), both will be called when a new pano will be loaded, and call your javascript function with the js() action,

    Zitat

    (2) I can intermittetly query the scene name to detect a change. So is there a way for javascript to ask what the name of the current scene is? I'm thinking something like this:

    yes, there is the xml.scene variable, it contains the name of the last loaded scene,

    best regards,
    Klaus

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!