Embeded flash krpano can use javascript code to add/get hotspots

  • Hi,

    I am embedded Krpano as HTML5:'auto'. It will load Krpano as HTML5 if browser supports webgl else loads flash.

    I am adding hotspot through javascript using krpano.call('addhotspot[name]'). I can get hotspot object in javascript using krpano.get('hotspot[name]') for HTML5 loaded pano.

    But the same code(javascript) is failing to get hotspot object for flash loaded pano. How to get hotspot object using javascript, when the krpano is loaded in flash. I want to use common javascript code for both HTML5/flash loaded krpano.

    Any suggestions would be greatly appreciated..

    Thanks,
    Vinu Kumar V.S

  • Thanks Klaus, could you please give the method / usage for changing the properties? Basically our use case is something like below..

    • We first add the hotspot & then fetch it back to associate icon url, hover / click actions
    • When the pano is loaded in 'auto' more.. we are having trouble to have this working on flash & forced to use 'prefer' mode for html5
    • We'd like this to be seamless to end user... and want to allow IE 11 users to experience.. our 360 deg. By switching back to 'auto'

    -Bhaskara

  • Hi,

    when getting a object from Flash to Javascript, then this object will be roughly 'copied' - that means a new Javascript object with the same (accessible) properties and value will be created - but there is no reference back to the original Flash object.

    That means for operating from Javascript with Flash and HTML5 do everything via the krpano set or call interfaces.

    e.g.
    instead of:

    Code
    var hs = krpano.get("hotspot[hs1]");
    hs.url = ...;
    hs.onclick = ...;
    ...

    do:

    Code
    krpano.set("hotspot[hs1].url", ...);
    krpano.set("hotspot[hs1].onclick", ...);
    ...

    Best regards,
    Klaus

Jetzt mitmachen!

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