Sie sind nicht angemeldet.

Lieber Besucher, herzlich willkommen bei: krpano.com Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.

1

Donnerstag, 8. September 2011, 15:48

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.

Quellcode

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

Quellcode

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

or

Quellcode

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

or

Quellcode

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)

Quellcode

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

Donnerstag, 8. September 2011, 18:33

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

Freitag, 9. September 2011, 08:25

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

Freitag, 9. September 2011, 11:18

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