PDA

View Full Version : Hotspot-events (onOver...) only working on second load: why?


phberlin
02-24-2008, 08:59 PM
Hi everyone,

I have made a testpano (so with bad quality and lots of ghosts and so on) to check if I can make a door (here: of a telephone box) open and close on mouseover within the pano. See here: http://philippkoch.com/panorama/tuer/ (pan left to see the telephone box; when the telephone is being hovered, the door "opens" and "closes" afterwards. Additionally, when being clicked, the pano zooms onto the telephone box, clicking again zooms out.)

The strange thing is: When being first loaded (empty browser cache), the hotspot image is shown and when you hover it with the mouse, you can see the "hand cursor" -- but the "onOver" and "onOut" event don't fire. After reloading the pano (so you load it again although it is already in the browser cache), it works. Why is this? (When testing offline, it works right away with first loading.)

Do I have to make sure the hotspots are loaded first, before the pano shows, or something? If so, how can I solve this?

My XML is:
<?xml version="1.0" ?>
<panorama>
<parameters>
loaderText = %3Ctextformat%3E%3Cfont%20face%3D%27Arial%27%20siz e%3D%2715%27%20color%3D%27%23%240%27%3E%0DDas%20Pa norama%20wird%20geladen%3A%20%09%247%0D%3C%2Ffont% 3E%3C%2Ftextformat%3E
layer_1=hotspots.swf

panoName = test_falkplatzl
panoSuffixes=_0.jpg|_1.jpg|_2.jpg|_3.jpg|_4.jpg|_5 .jpg

qualityMotion=low
qualityStatic=best
behaviour=2
sensitivity=100
threshold=0.0000001
friction=0.85
</parameters>

<hotspots>
<global>

<!-- Telefonzelle -->
<box id="telezelle_zu" url="tuer_zu.png" pan="-86.00" tilt="-3.00" alignX="-0.41" alignY="-0.52" depth="1" scaleX="0.69" scaleY="0.74" smoothing="1" onClick="druff()" onOver="auf()"

auf="
telezelle_zu.alpha=0,100
telezelle_auf.alpha=1,50
onOut=zu()
"

zu="
telezelle_zu.alpha=1,50
telezelle_auf.alpha=0,100
"

druff="
pano.pan_v=0
pano.tilt_v=0
pano.zoom=2.65,200
pano.pan=-85,200
pano.tilt=-3,200
onClick=wech()
"

wech="
pano.pan_v=0
pano.tilt_v=0
pano.zoom=1,200
onClick=druff()
"
/>

<box id="telezelle_auf" url="tuer_auf.png" pan="-86.00" tilt="-3.00" alignX="-0.41" alignY="-0.52" depth="1" scaleX="0.69" scaleY="0.74" depth="1" smoothing="1" alpha="0" />

<!-- // Telefonzelle -->

</global>
</hotspots>
</panorama>

I'd be so happy if someone could point me towards what might be the problem here... It's not too satisfying having to load the pano twice to make it work..

Thanks in advance for any hints & suggestions..
Phberlin

zleifr
02-24-2008, 09:58 PM
Hi Phberlin:

I am pretty sure I know how to fix that problem, not so sure I know why it does get fixed on reloading the pano, that is entirely a mystery to me. But here is the reason I believe that it is not working: the onOver and onOut events are attached to telezelle_zu, which (I believe) is being rendered underneath telezelle_auf. You have the depth manually set on both to 1, but FPP assumes that hotspots defined later in the XML go on top of spots defined earlier in the XML. I am guessing that putting them both on depth="1" is confusing poor FPP. SO, to fix it: either change the depths so that the one with the onOver / onOut events is always on top, and note that alpha="0" does not make a hotspot entirely deactivated, only visible="0" does that, ones that are alpha="0" still receive events although you can't see them. So set ...zu to depth="2" and ...auf to depth="1" or remove the depth attributes and switch their order in the XML.

Zephyr

phberlin
02-24-2008, 11:36 PM
Hey Zephyr,

thank you so much! You did it again (not the first time you helped me) :-) it was indeed solved as soon as I changed the depth-values. Thank you!

Besides -- I wrote you a mail using the contact form at flashpanos.com some time ago; maybe it has gone to spam? I would like to know if there is any news about the encryption plugin (availability, pricing)?

Best regards, Philipp

PS. I just bought your extensible load meter plugin that second :-)

zleifr
02-25-2008, 12:18 AM
Hi Phillip,

I don't think I did get that email. The encryption plugin is basically ready. I just need to squash a bug or two. Send me an email at zleifr at yahoo dot com.

Zephyr