scene switching method that uses the javascript

  • Hello.

    I want to switch the scene using javascipt.

    function changepano(panoName)
    {
    var krpano = document.getElementById("krpanoSWFObject1");
    krpano.call("loadscene(" + panoName + ");");
    }


    I am using this code.

    Please look at the test site.

    Test site
    http://tukucchao.s602.xrea.com/test.html


    I click the hot spot.

    Flashes of hot spots faster.

    This would be a bug? Please tell me.


    Regards,

  • Hi,

    no bug in krpano, but a bug in the Panotour xml, the xml hotspot animation code there hasn't a 'stop' condition for the case that the hotspot will be unloaded/removed, so the animation action keeps running also when then a new pano will be loaded and the hotspot has been removed - and when there is the hotspot with the same name, the old and the new animation actions will run on the same hotspot and so the the animation will get faster with each new pano.

    In your test_core.xml change in the 'animate' <action> this part:

    Code
    delayedcall(%2, animate(%1,%2) );


    to this:

    Code
    delayedcall(%2, if(loaded, animate(%1,%2)) );

    Best regards,
    Klaus

  • After modifying the xml was movement successfully.

    Thank you.


    >Sorry, but how do you mean that???

    Because it uses the Panotour Pro, it is bothersome to modify the xml each time.

    Is this Panotour Pro bug?


    Regards,

  • Is this Panotour Pro bug?

    No as far as you do not call the panotour load action.

    Panotour generates another load action that interrupts the animation, so the animation is not speed up when reopening the scene.

    Instead of loadscene, call mainloadscene .

    Or if you still want to use loadscene, call also the other parts of the mainloadscene actions.


    By the way we added some checks in the animate action, so in the 2.3 final version you should not have such behaviour even when using the wrong loadscene action.

    Gérald

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!