You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Thursday, September 8th 2011, 3:48pm

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.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<action name="hide_all_hotspotCaptions_except">
		<!--showlog(true);-->
		
		set(hotspotNumber, %1);
				
		for(set(i,0), i LT hotspot.count, inc(i),
			
			set(hotspotStyle, get(hotspot[get(i)].style));
						
			if(hotspotStyle=="captionHotspot",
				
				if(i != hotspotNumber,
					<!--Ausblenden-->
					set(hotspot[get(i)].visible, false);
				,
					<!--Einblenden-->
					set(hotspot[get(i)].visible, true);
				);
			);
		);	
 </action>

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):

Source code

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

or

Source code

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

or

Source code

1
2
3
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)

Source code

1
2
3
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*

2

Thursday, September 8th 2011, 6:33pm

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

3

Friday, September 9th 2011, 8:25am

Solution

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).

4

Friday, September 9th 2011, 11:18am

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