View Full Version : having various hotspots glow up on loading pano
ftrippie
11-14-2008, 08:53 PM
Hi,
Strange question perhaps, but I have multiple maps (different views) in which the same pano appears. This means there are various ways of loading that same pano (via these various maps). But I would like to detect which pano is loaded and then have the hotspots on all those maps (being the hotspot for that particular pano of course) glow red.
I know the easy way is to create for every hotspot another hotspot with the same position PLUS the red glow parameter and have that linked to that particular pano. But since I have a lot of hotspots already, I wonder if that's not gonna be overkill.
Now, since I don't know how to detect if a particular pano is loaded (is that possible?), I was thinking of creating extra transparent hotspot per pano (linked) and if that one is active (meaning that pano is loaded), to glow the corresponding hotspots on all these various maps. So far so good. However, at the moment that pano is replaced by a different one, I can't remove the red glow anymore on those previous hotspots. At least not in an easy way...
Any ideas?
My code so far:
<spot
id="detectspot"
url="trans.png"
linked="P03E"
salign="LT"
static="1"
staticX="96"
staticY="478"
onLoad="realspot.glow=1.6,400,easyin,glowDown"
glowUp="glow=1.6,400,easyin,glowDown"
glowDown="glow=1,300,easyout,glowUp"
/>
<spot
id="realspot"
url="P03E.png"
salign="LT"
static="1"
staticX="76"
staticY="498"
onClick="loadPano(panoName=P03E&panoType=mov);
onLoad="glow=0"
/>
Scott Witte
11-15-2008, 04:48 PM
...However, at the moment that pano is replaced by a different one, I can't remove the red glow anymore on those previous hotspots. At least not in an easy way...
How about this: Create a custom function that turns off the glow for all your hotspots. When you click any spot to load any new pano call that custom function at the same time. It should execute before the new pano loads. When the new pano loads it will add glow to the appropriate hotspot(s) using your existing code.
Even simpler, call the custom function or even place its code in an onTransitionStart global function. That way it executes automatically whenever you load a new pano.
ftrippie
11-15-2008, 05:48 PM
Thanks! That was a good idea!
I never really dug into the onTransitionStart and End things, but in this case it's very usefull!
Just to explain what I have done:
1. create a transparent hotspot linked to 1 pano (for every pano 1 each). that will detect which pano is loaded.
2. on activation of that hotspot (meaning pano is loaded), glow ALL the hotspots related to that particular pano on ALL the different maps (with OnLoad)
3. added following global funcion:
onTransitionStart="marker1.glow=0; marker2.glow=0" etc.
So now it will turn off ALL the glows at loading any pano and then it will detect with the detect-hotspot for which one to turn it on.
Thanks again Scott!
ftrippie
11-15-2008, 05:56 PM
One more thing though;
I am now naming all the relevant hotspots in the onTransitionStart function:
onTransitionStart="marker1.glow=0; marker2.glow=0" etc.
I tried doing that in a Global way:
onTransitionStart="glow=0"
But that doesn't seem to reinitialise the spots which had being glowing before and doesn't turn off the glow. It works the first way (naming them all), but I just wondered why it wouldn't work the global way...
(both are defined in <global/> of course...
(still happy, just wondering...)
ftrippie
11-15-2008, 06:56 PM
And another thing if I may; how do I make it blinking?
I can make a hotspot itself glow-blinking, but I can't control from this 'detect-hotspot' to make the 'marker-hotspot' blinking...
(I can make it glow allright, but glow-blinking not)
probably something to do with global function or not, but I can't find it...
to make a hotspot itself glow-blinking I use:
onLoad="glowDown" glowUp="glow=1.6,400,easyin,glowDown" glowDown="glow=1,300,easyout,glowUp"
but I can't seem to apply that other hotspots... any idea?
Cheers,
FTrippie
ftrippie
11-18-2008, 04:22 PM
Hi Scott or others,
I am still searching for an answer to my last question; how do I make it blinking? Any ideas?
I can make a hotspot itself glow-blinking, but I can't control from this 'detect-hotspot' to make the 'marker-hotspot' blinking...
(I can make it glow allright, but glow-blinking not)
probably something to do with global function or not, but I can't find it...
to make a hotspot itself glow-blinking I use:
onLoad="glowDown" glowUp="glow=1.6,400,easyin,glowDown" glowDown="glow=1,300,easyout,glowUp"
but I can't seem to apply that other hotspots... any idea?
Cheers,
FTrippie
Scott Witte
11-18-2008, 06:08 PM
FTrippie,
I apologize that I don't have to time really dig into a cleaver way to accomplish what you want but maybe a different approach might help.
How about having one hotspot per map that blinks as you want? When you load a pano have it change the position of those spots to the corresponding coordinates on the map. This effectively "switches off" the previous blinking hotspots and "switches on" the new ones, although what you really are doing is moving them.
ftrippie
11-18-2008, 10:51 PM
Thanks Scott for replying.
Yep, I thought about that too. But stepped away from it since some of the maps are just diagrams and can contains the same pano hotspot at multiple different positions as well.
The glowing thing seemed nice. At the moment I have it working the way we were thinking, but just glowing, not blinking. Will keep on searching..
Cheers,
FTrippie
siesfor
11-19-2008, 02:02 AM
hey FTrippie,
You were on the right track, about it needing to be global.
what you'll want to do is place your...
glowUp="glow=1.6,400,easyin,glowDown"
glowDown="glow=1,300,easyout,glowUp"
functions inside of your <global> tag.
then, call them directly.
following your transparent "detectspot" png strategy...
<spot
id="detectspot"
url="trans.png"
linked="P03E"
visible="0"
onLoad="realspot.glowDown"
/>
ftrippie
11-19-2008, 11:22 AM
Thanks Siesfor! You are a star!.
I am sure I tried something similar (i already had the functions in global) but must have mixed up something, because i couldn't get it to work.
But now it works! Brilliant!
vBulletin® v3.7.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.