Dynamic style assignment on a hotspot created in an action?

  • addhotspot(test);
    set(hotspot[test].style, stylename);

    seems to have no effect on said hotspot style. Style seems to work only when assigned statically in xml. Is there a way to apply a style by name on a newly created hotspot via action?

  • Thank you very much!
    I there any place where these methods and functions are documented?Also I find that this approach messes up hotspots zorder. In flash version setting style zorder attribute seems to help, but in html5 version the order seems to be different if you add hotspots without style, load hotspots from action tag of from javascript using krpano.call method. And no way to reorder hotspots afterwards.
    Adding hotspots without style always sets visible zorder in the order of adding: last on top. But when using loadstyle this order is broken. And it is broken differently depending on which version (swf, html5) you use and is it js or action interface. How can i fix it? Is it because javascript krpano.call is asynchronous and action is synchronous?

  • I have no experience in adding hotspots by using javascript.

    I had no problems with zorder property (Flash and HTML5).

    Set dynamically zorder order by using variable.


    In javascript this would probably like this:

    but as I wrote I have no experience in javascreept...

    Piotr

  • Thank you again!

    I figured it out. I had an action that was adding hotspots if they were missing. And somehow I was getting different results on if(hotspot[name] === null, ...) depending on if action was called from another action or from javascript. So zorder was not applied correctly.

Participate now!

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