You are not logged in.

1

Wednesday, December 4th 2013, 9:11am

Universal tween action for hotspot

Hi All,

I'm struggling with a bit of code in a project. I'm loading several hotspots in a virtual tour and I want them to draw attention with a little motion tween, in this case a 'hartbeat'.

I wrote a little action for one of the hotspots but now I want to make the action universal to all hotspots without mentioning the specific hotspot names in the action itself.

I want to use the following flow:
This action is loaded in the hotspot-style with onloaded="beat-spots();"
This action is replaced by another motion tween with an onhover=" ;"
This action has to be loaded again with an onout=" ;"

I tried to fix this with something like: tween(hotspot(get(name)).scale, ... ... ... but the get-function doesn't work. As far as I understand the code this seems quite logical because the get will result in a null since there is no hotspot available on an onOut situation.

But, is it possible to rewrite this little piece of code to a repeating and universal action for all hotspots in a tour and with dynamic names?

See the projectlink: www.littleplanet.nl/clients/123dv/supernova.html
See the the code below:

Source code

1
2
3
4
5
6
7
8
<action name="beat-spots">
tween(hotspot[hotspotname].scale, 0.5, 1, default,	
delayedcall(0.5,	
tween(hotspot[hotspotname].scale, 0.4, 1, default,	
delayedcall(0.3,
beat-spots();	
); ); ); ); 
</action>

2

Monday, December 9th 2013, 9:24am

No reply at all on this?


Am I missing something?

3

Monday, December 9th 2013, 9:28am

Hi,

any action code that will be called from plugin/hotspots events can access the plugin/hotspot properties directly.

e.g. this code:

Source code

1
2
3
4
5
6
<hotspot name="hs1" ... scale="1.0" ... onclick="test();" />

<action name="test">
  trace(name);
  tween(scale,2.0);
</action>


will show the name of the calling hotspot in the krpano log:

Source code

1
INFO: hs1


and tween it's scale to 2.0.

Best regards,
Klaus