PDA

View Full Version : Hotspots & Dropdown Menu Plugin


Panomaker
02-14-2008, 09:02 AM
I'm using the FlashPanos Dropdown Menu Plugin which works well so far but I would like to make better use of the XML.

I would like to have the main navigation hotspots in my main.xml file with individual hotspots unique to each panorama in their own sub xml file. I tried to add a unique hotspot for 'Bedroom 1' in the bed1.xml file but the referred to 'hotspots' parameters completely overwrites the 'hotspots' parameters in the main.xml file. The only remedy was to copy and paste the navigation hotspots into the bed1.xml file. I would like to avoid this duplication and make the xml files simpler to update.

I'm used to writing CSS and working with the cascade. Is it possible to achieve this in XML? Here are the links I'm working with:
http://horseshoeinn.co.uk/vr/main.htm
http://horseshoeinn.co.uk/vr/main.xml
http://horseshoeinn.co.uk/vr/bed1.xml

This is the hotspot I would like to add to all the bedroom panos taking users back to the 'Guest Rooms' part of the website:
<spot id="website" static="1" salign="BC" staticX="0" staticY="-12" alpha="0.7" url="images/gotorooms.png"
onOver="scale=1,600,elastic;depth+=25;alpha=1,1000"
onOut="scale=1,300;depth-=15;alpha=0.7,1000"
onClick="openUrl(http://horseshoeinn.co.uk/accommodation.htm, _self)"
/>

Thank you in advance for your help and forgive my ignorance of XML.

Cheers, David

Aifos
02-14-2008, 01:11 PM
it is not necesary to use a separate xml for one panorama if you use linked parameter!
like this:
linked="pano/bedroom1"

if you want to link that spot to more than one panorama, set this parameter like this:
linked="pano/bedroom1|pano/bedroom2|pano/bedroom3"
use | to separate the path

this way youґll have everything on the main.xml

cheers!

Panomaker
02-14-2008, 01:27 PM
Hi Aifos

Thanks for the tip. I was keen to use a separate XML file for each panorama for storing individual unique hotspots and other parameters for that panorama alone.

I found with my first attempt of adding a unique hotspot to the separate XML file it wipes out all the hotspots from the main.xml file.

There's probably a very simple answer I'm missing.

Cheers, David

Panomaker
02-14-2008, 02:31 PM
Ah, OK, I think I understand the 'linked' idea now. Will go and try.

cheathamlane
02-14-2008, 02:51 PM
Hi David:

Well, there's two simple answers. :)

One is to use the "linked" (and/or "unlinked") attributes, and define everything in one XML file.

The other is to go ahead and use an individual XML file for each pano -- but keep in mind you'll need to define all of your hotspots again (the ones which are the same from pano to pano). You can leave the <parameters> area alone, but will need to duplicate everything from <hotspot> to </hotspot>.

XML for the initial panorama:
<?xml version="1.0" ?>
<panorama>
<parameters>
segments = 25
qualityStatic = high
qualityMotion = low
layer_20 = files/hotspots.swf
layer_30 = cl_dropdown_menu_v2.5.swf
loaderText =
</parameters>
<cl_dropdown_menu>
transitionTime = 500
tranSitIonType = stripes
xMlPath = pano
My first Panorama=path/to/My/panoRama
Another panorama=path/to/My/other/panoRama&xml_file=path/to/xml/file.xml
</cl_dropdown_menu>
<hotspots>
<global onStart="" onEnterFullscreen="">
<pano onPress="" onRelease="" />

<!--// BEGIN COMMON HOTSPOTS //-->

<spot id="common_1" staticX="-156" staticY="-25.00" align="BR" url="my_hotspot.png" blockMouse="1" onClick="" />

<spot id="common_2" staticX="-156" staticY="-25.00" align="BR" url="my_other_hotspot.png" blockMouse="1" onClick="" />

<!--// END COMMON HOTSPOTS //-->

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

XML for the second panorama, with individual hotspots:
<?xml version="1.0" ?>
<panorama>
<hotspots>
<global onStart="" onEnterFullscreen="">
<pano onPress="" onRelease="" />

<!--// BEGIN COMMON HOTSPOTS //-->

<spot id="common_1" staticX="-156" staticY="-25.00" url="my_hotspot.png" />

<spot id="common_2" staticX="-156" staticY="-25.00" url="my_other_hotspot.png" />

<!--// END COMMON HOTSPOTS //-->

<!--// BEGIN SPECIFIC SPOTS //-->

<spot id="spot_for_second_pano" url="another_hotspot.png" pan="93.00" scale="1.3" onClick="" />

<spot id="spot2_for_second_pano" url="another_hotspot2.png" pan="203.00" scale="8.3" onClick="" />

<!--// END SPECIFIC SPOTS //-->
</global>
</hotspots>
</panorama>

I generally use the linked parameter, so can't vouch 100% for my code above -- but it should work. There are other people who have done things this way. Maybe they'll chime in.

Panomaker
02-18-2008, 08:53 AM
Hi Patrick,

Separate XML files is the way to go then but unfortunately I have to repeat not just the hotspot parameters but everything in the main.xml file in order for my panos to work correctly on inbound links e.g. individual pan, tilt etc. It's a shame there is no way to call more than one xml file or alternatively have an easy update method in Dreamweaver e.g. library item (they don't work with XML files). The only method I can see working which is complicated is to write ASP to dynamically generate XML files from a database but this is more trouble than it's worth. So for the time being it will have to be duplication and the Find & Replace tool.

I just have one more question. If a completely new XML file is called for each panorama does your plugin download all the panoramas in the background? I'm sure it does. On further consideration perhaps this is a disadvantage in terms of bandwidth cost i.e. maybe the viewer only wants to see the pano for their specific bedroom and yet all the panos have been downloaded. I guess with everything there are pros and cons.

Best wishes, David.

cheathamlane
02-18-2008, 02:35 PM
I just have one more question. If a completely new XML file is called for each panorama does your plugin download all the panoramas in the background? I'm sure it does. On further consideration perhaps this is a disadvantage in terms of bandwidth cost i.e. maybe the viewer only wants to see the pano for their specific bedroom and yet all the panos have been downloaded. I guess with everything there are pros and cons.

Hi David:

The DropDown Menu doesn't actively load anything -- It simply tells FPP to load a new panorama, when you select a new one from the DropDown Menu. FPP handles the loading, as normal.

So, only one panorama at a time -- it's not preloading the list.