Hello dear Panoheads,
im trying to understand the following:
How is the style that a hotspot calls related to the hotspot, I believe the style becomes part of it.
If the style contains an action, how does it behave, will the action be a child of the hotspot ?
If the action wants to call an attribute of the hotspot, must it reference its parents attribute or is it nested deeper and if so how to reference attributes through 'nested inheritance'.
In this particular case:
I have been trying to add always visible captions to hotspots, where the function is part of the style of the hotspot (so it needs writing and refering to only once) and the text to be displayed is set as a parameter of the hotspot element. I found a very useful code snipped by KR. Now the code looks like this:
<style name="skin_hotspotstyle" url="vtourskin_hotspot.png" scale="0.5" edge="top" oy="0" distorted="false"
tooltip=""
onclick="if(linkedscene, skin_hidetooltips(); tween(scale,0.25,0.5); tween(oy,-20,0.5); tween(alpha,0,0.5); looktohotspot(); loadscene(get(linkedscene),null,MERGE,BLEND(1)); skin_updatescroll(); );"
onloaded="atttooltip();"
/>
<action name="atttooltip">
txtadd(tooltipname, 'tooltip_', get(name));
addplugin(get(tooltipname));
txtadd(plugin[get(tooltipname)].parent, 'hotspot[', get(name), ']');
set(plugin[get(tooltipname)].url,'%SWFPATH%/plugins/textfield.swf');
set(plugin[get(tooltipname)].align,bottom);
set(plugin[get(tooltipname)].edge,bottom);
set(plugin[get(tooltipname)].x,0);
set(plugin[get(tooltipname)].y,-20);
set(plugin[get(tooltipname)].width,200);
set(plugin[get(tooltipname)].autoheight,true);
set(plugin[get(tooltipname)].background,false);
set(plugin[get(tooltipname)].border,false);
set(plugin[get(tooltipname)].css,'text-align:center; color:#FFFFFF; font-family:Arial; font-weight:bold; font-size:16px;');
set(plugin[get(tooltipname)].textshadow,1);
set(plugin[get(tooltipname)].textshadowrange,6.0);
set(plugin[get(tooltipname)].textshadowangle,90);
copy(plugin[get(tooltipname)].html, source);
set(plugin[get(tooltipname)].enabled,false);
</action>
Alles anzeigen
Now my wish is that from a hotspot like this:
<hotspot name="spot1" style="skin_hotspotstyle" ath="0.000" atv="0.000" distorted="false" zoom="false" linkedscene="scene_2"/>
I would be able to grab the name="spot1" attribute and have the tooltip display it. I can directly set 'html' in the function and have all tooltips read the same but I am failing to declare the source for copy(plugin[get(tooltipname)].html, source); to reference 'name' from 'hotspot'.
I did believe the content of the style referenced by the hotspot would be basically copied into each hotspot that refers to it at runtime. As such I would have believed that when calling
inside the function it should return the 'name' of the actions parent (the hotspot that is) but it does not. Maybe I am failing to understand how 'nested inheritance' works and its more than just adding dots, but I tried a few things and so far no luck.
Thank you very much everyone who can share some wisdom.