krpano - javascript events

  • Hello!
    krpano is looking good.
    But I was not found information about javascript integration. For example:
    When i do something in pano, click on hotspot, how can i connect this to my js code?
    there must be something, like this:
    var krpano = document.getElementById("krpanoSWFObject");{ do smth, in ev - info about event, position, hotspot });

    Is it possible in krpano? i can manage pano, but in reverse? call some js function?
    I don't found really information about that, no examples, no code, no docs.

  • Hello,

    According to your documentation I just need to use a "js(...);" for the "onclick" attribute in the XML file but it seems not work :(

    I have a hotspot like this in the XML :

    <hotspot name="michel" style="person" ath="-56.853" atv="2.350" onclick="js(showPerson(get(name)));" />

    And in my JavaScript :

    var showPerson = function(name){  ... }

    Did I miss something ? Note that using JavaScript to create an hotspot and set his onclick event works.

    Is there any limitations with the demo version ? Settings that must be done to make it work as spécified in your documentation ?

    Best regards

  • Hi,

    if testing locally with Flash, make sure to use a localhost server (like the krpano Testing Server).
    Due the Flashplayer security restrictions it's not possible to call Javascript functions in Flash when running on file:// urls.

    Best regards,

Participate now!

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