You are not logged in.

Zephyr

Professional

  • "Zephyr" started this thread

Posts: 1,003

Location: Netherlands

Occupation: Web developer

  • Send private message

1

Monday, November 24th 2008, 11:20am

keeping 2 plugins while removing others

I have 2 plugins I want to keep at every
panorama,but the Still plugin, I want only at a specified location, and dissapear
when I move to another one. The still plugin is a just a shell and
loads throught a parameter, the specified file. Thats why It's loaded
in global.xml (this file is loaded first, and through an action it
loads the panorama xml.) So everything defined in global.xml can be
accessed from other xmls. this allows for lesser bulk lines to be coded
and easier access to plugins. Here's a fast sketch:


global.xml
onstart("loadpano(%SWFPATH%/bolfoto/location_1.xml, null, KEEPBASE|KEEPPLUGINS,BLEND(1));")
<plugin name="firsstill" url="still.swf?file=jpg/1.swf" keep="false" /> //first still
<plugin name="secondstill" url="still.swf?file=jpg/2.swf" keep="false" /> //second still
<plugin name="gui" url="plugins/gui.swf" keep="true"/>
<action name="showimage"> set(plugin[%1].visible,true); </action>
<action name="hideimage"> set(plugin[%1].visible,false); </action>
location_1.xml

<hotspot name="info_helmi" ath="-105" zoom="true" atv="30"
url="../images/billboard2.png" onclick="action(showimage,firsstill);"
/>

click on another hotspots, loads location 2
location_2.xml

ALWAYS KEEP GUI plugin

HIDE firsstill/thirdstill or whatever still that is visible

<hotspot name="info_helmi" ath="-105" zoom="true" atv="30"
url="../images/billboard2.png" onover="" onout=""
onclick="action(showimage,secondstill);" />

In short: I want to keep global.xml actions and other global stuff defined in there and I want to keep the GUI.swf (this has interface stuff in it, so it must not be reloaded, it has to stay). But I want to call the image through the still.swf plugin through a hotspot click and remove the plugin (hide it), by either @ load of another location or manually closed by the user through a click.

Atm I run a hideallimages action when ever I call a loadpano function. the hideimagesfunction has all the names of all the stills im using. This doesn't seem very optimized (calling the action whenever I change pano, and defining all the images).

2

Monday, November 24th 2008, 1:27pm

Hi,

what do you think about - define the still plugins in the locations xml?
and when loading this xml file use the MERGE parameter instead of KEEPPLUGINS,
then it should work as you described,

a other possiblitiy would be to add and remove plugins/hotspots with actions:
http://krpano.com/docu/actions/#addplugin

best regards,
Klaus

Zephyr

Professional

  • "Zephyr" started this thread

Posts: 1,003

Location: Netherlands

Occupation: Web developer

  • Send private message

3

Monday, November 24th 2008, 2:07pm

Thank you, that worked :) I focussed too much in keeping all the non-hotspot stuff in 1 xml, that I overcomplicated things. Putting it in seperate xml files, setting keep="false" and MERGE worked just fine :)

Similar threads