Change hotspot-visiblity via krPano-action

  • I think i just stumbled upon another bug in the new krPano release 1.0.8.14.
    Until now i used the following script to make a certain hotspot visible.


    But now all this action does, is making all hotspot invisble. This is because the check for ' if(i != hotspotNumber)' ALWAYS returns false. And to make things worse, this only mailfunctions on my Android-Devices. My iPad and the other iDevices don't seem to be bothered by this. With them, all except the selected one are becoming invisible.

    In my testing i also assessed, that things like the following don't work (anymore):

    Code
    set(hotspotNumber, 7);
    set(hotspot[get(hotspotNumber)].visible, true);


    or

    Code
    set(hotspot[get(7)].visible, true);


    or

    Code
    for(set(i,7), i LT 8, inc(i),
    	set(hotspot[get(i)].visible, true);
    ;

    And now (to top it all) this last example DOES work (but it's useless to me)

    Code
    for(set(i,0), i LT 8, inc(i),
    	set(hotspot[get(i)].visible, true);
    ;

    This works, until i set i to 4. Then it suddenly stops.

    Anyone a solution for this? Help would be pretty much appreciated. I'm starting to go grey...again... *blink*

  • Hi,

    I have to say that's strange...
    I have tested your code now and it was working fine (in Flash and HTML5)...

    two notes to be sure that they are not the reason for the problem:

    1. the 'style' is case-sensitive, so the case must be same when the defining the hotspots and when checking for it
    2. the index is 0-based, so when you have 8 hotspots the last hotspot would have index 7


    so could please post an online example?

    best regards,
    Klaus

  • Though it did cost me a considerable amount of time and nerves, i finally found the problem and an appropriate solution.
    But i won't share it of course, since I'm pure evil...

    Ah...kidding... *tongue*

    The flash player considers the zorder of the hotspots when looping them, the html5 one does not. I don't know, if this behavior is new in the final version, but i think so because the 1.0.8.14RC3 did function without having to compensate for this inconsistency.
    So saying make hotspot at index 'x' visible will not be the same in both players. That has been the root of evil here (besides me of course).

  • Hi,

    right, in the Flash version the hotspots were sorted by their zorder and in HTML5 version the html-native "z-Index" was used, but that behavior was the same also in the last RC/beta versions and also in 1.0.8.12...

    btw - relaying on the index is generally not optimal or recommended - the index is not though for such usage, because the index is internal, it will not be defined by the user! the index is okay for looping through all elements but for direct addressing I would recommend using the 'name' of the elements!

    best regards,
    Klaus

Participate now!

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