I like dynamic code, so I added some lines to my xml and hotspot plugin code.
I wanted to show scene name on hotspot rollover but without typing the scene title again and again in the xml.
Also I wanted to add looktohotspot action without having to hardcode hotspot name every time I call it.
So I replaced hotspot onclick with scenetoload param,
added hotpost style with onclick action where I get scenetoload param from hotspot itself,
and added gotonewscene action which includes looktohotspot and loadscene
<!-- actions -->
<action name="gotonewscene">
looktohotspot(%2, 75, smooth(300,-300,600));
loadscene(%1, null, MERGE, BLEND(1));
</action>
<!-- hotspot styles -->
<style
name="hotspot_goto"
url="%BASEDIR%/hotspots/hs.swf"
alturl="%BASEDIR%/hotspots/hs.png"
onover="set(zorder, 2000);"
onclick="gotonewscene(get(scenetoload), get(name))"
/>
<!-- scenes -->
<scene name="scene_wardrobe" title="Wardrobe" >
<!-- goto gotspots -->
<hotspot name="goto1" style="hotspot_goto" ath="185" atv="4" scenetoload="scene_wardrobe" />
Alles anzeigen
And in the hotspot code, I added rollover/out listeners and label,
also some code to set label text to show scene title which the hotspot will load on click (scenetoload param from xml)
hit.addEventListener(MouseEvent.ROLL_OVER, showLabel);
hit.addEventListener(MouseEvent.ROLL_OUT, hideLabel);
public function registerplugin(krpanointerface:Object, pluginfullpath:String, pluginobject:Object):void {
var scenetoload:String = (_krpano.get("hotspot[" + _plugin.name+ "].scenetoload"));
setLabelText(_krpano.get("scene[" + scenetoload + "].title"));
}
Hope this is usefull! Cheers!
Here's an exapmple: hotspot demo 2.zip