PDA

View Full Version : Can't use hotspot pan and tilt values as variables?


rdhoore
11-27-2008, 09:29 PM
Hi,

I'm learning to make xml's to control FPP, and I'm running into many troubles. Here is one of them, a mild one:

In the <hotspots> section in the pano's xml, I have:

<global onStart="pano.tilt=hs1.tilt,4999; pano.pan=hs1.pan,6999; pano.zoom=3.5,6999; timer+=1,7300,,hs1.onClick">

The object hs1 is a hotspot <spot id="hs1" pan="-59.00" tilt="-3.00" ...>. My problem is: the pano only zooms, the pan and tilt don't change. However, hs1.onClick does get executed fine, so there is no problem with hs1.

I tried assigning these actions to a hotspot onClick event instead of doing them in global onStart, and the result was the same, so it's not that hs1.tilt and hs1.pan are not available yet at the time of execution of global onStart.

Does anyone know why it's not working? :confused: I know I could assign the values themselves, but if I don't understand this already, then how much hope is there I will be able to figure out my other, much more serious problems.

Here is the pano (http://www.virtualtour.be/era/renomar/offices/pano.swf) and the xml (http://www.virtualtour.be/era/renomar/offices/pano.xml).

Thanks.
Ronny

rdhoore
11-27-2008, 09:47 PM
Then another problem, related to this pano, is that the 2nd pano loads, but after about 10 to 20 sec, it goes back to the first pano, without any good reason... There is no onStart event in the 2nd pano's xml (http://www.virtualtour.be/era/renomar/offices/panos.xml) which could cause this. From that moment onwards, every so many seconds it toggles between the first and the second pano.

Apparently, the hs1.onClick event of the 2nd xml is executed as well, but I don't tell it anywhere in the xml to do so....? :-(

According to the docs, calling loadPano with another xml should clear the hotspots section:

loadPano(panoName=panoramas/nature&xml_file=nature.xml) (loads panorama with a new parameters file)

This action applies new panorama parameters from XML file, new limits parameters (if your file contains <limits></limits> section), new autorotation parameter (<autorotator></autorotator>). Section <hotspots></hotspots> will be reload by default as well (all hotspots and global parameters will be unloaded and new <hotspots></hotspots> XML will be placed). You can disable reloading of <hotspots></hotspots> parameters using global.disableReloading=1 (it is useful if you have the same hotspots set for all panoramas in tour and arbitrary tour's entry point).

Does this make sense to anyone?

Regards,
Ronny

siesfor
11-30-2008, 03:21 PM
the 2nd pano loads, but after about 10 to 20 sec, it goes back to the first pano, without any good reason... There is no onStart event in the 2nd pano's xml which could cause this.

add onStart="" to your 2nd xml and it'll keep it from switching back and forth.